BREAKING CHANGE(core): rework core device architecture: consolidate protocols into a protocols/ module, introduce UniversalDevice + factories, and remove many legacy device-specific classes (breaking API changes)
This commit is contained in:
172
ts/index.ts
172
ts/index.ts
@@ -4,31 +4,24 @@
|
||||
* Supports: Scanners, Printers, SNMP devices, UPS, DLNA, Sonos, AirPlay, Chromecast
|
||||
*/
|
||||
|
||||
// Main exports from DeviceManager
|
||||
// ============================================================================
|
||||
// Core Device Manager
|
||||
// ============================================================================
|
||||
|
||||
export {
|
||||
DeviceManager,
|
||||
MdnsDiscovery,
|
||||
NetworkScanner,
|
||||
SsdpDiscovery,
|
||||
Scanner,
|
||||
Printer,
|
||||
SnmpDevice,
|
||||
UpsDevice,
|
||||
DlnaRenderer,
|
||||
DlnaServer,
|
||||
Speaker,
|
||||
SonosSpeaker,
|
||||
AirPlaySpeaker,
|
||||
ChromecastSpeaker,
|
||||
SERVICE_TYPES,
|
||||
SSDP_SERVICE_TYPES,
|
||||
} from './devicemanager.classes.devicemanager.js';
|
||||
|
||||
// Abstract/base classes
|
||||
export { Device } from './abstract/device.abstract.js';
|
||||
// ============================================================================
|
||||
// Universal Device & Features
|
||||
// ============================================================================
|
||||
|
||||
// Universal Device & Features (new architecture)
|
||||
export { UniversalDevice } from './device/device.classes.device.js';
|
||||
export { UniversalDevice, type IUniversalDeviceInfo, type IDeviceCreateOptions } from './device/device.classes.device.js';
|
||||
export {
|
||||
Feature,
|
||||
ScanFeature,
|
||||
@@ -47,34 +40,66 @@ export {
|
||||
type ISnmpFeatureOptions,
|
||||
} from './features/index.js';
|
||||
|
||||
// Scanner protocol implementations
|
||||
export { EsclProtocol } from './scanner/scanner.classes.esclprotocol.js';
|
||||
export { SaneProtocol } from './scanner/scanner.classes.saneprotocol.js';
|
||||
// ============================================================================
|
||||
// Device Factories
|
||||
// ============================================================================
|
||||
|
||||
// Printer protocol
|
||||
export { IppProtocol } from './printer/printer.classes.ippprotocol.js';
|
||||
|
||||
// SNMP protocol
|
||||
export { SnmpProtocol, SNMP_OIDS } from './snmp/snmp.classes.snmpprotocol.js';
|
||||
|
||||
// UPS protocols
|
||||
export { NutProtocol, NUT_COMMANDS, NUT_VARIABLES } from './ups/ups.classes.nutprotocol.js';
|
||||
export { UpsSnmpHandler, UPS_SNMP_OIDS } from './ups/ups.classes.upssnmp.js';
|
||||
|
||||
// DLNA/UPnP protocol
|
||||
export {
|
||||
createScanner,
|
||||
createPrinter,
|
||||
createSnmpDevice,
|
||||
createUpsDevice,
|
||||
createSpeaker,
|
||||
createDlnaRenderer,
|
||||
type IScannerDiscoveryInfo,
|
||||
type IPrinterDiscoveryInfo,
|
||||
type ISnmpDiscoveryInfo,
|
||||
type IUpsDiscoveryInfo,
|
||||
type ISpeakerDiscoveryInfo,
|
||||
type IDlnaRendererDiscoveryInfo,
|
||||
} from './factories/index.js';
|
||||
|
||||
// ============================================================================
|
||||
// Protocol Implementations
|
||||
// ============================================================================
|
||||
|
||||
export {
|
||||
EsclProtocol,
|
||||
SaneProtocol,
|
||||
IppProtocol,
|
||||
SnmpProtocol,
|
||||
SNMP_OIDS,
|
||||
NutProtocol,
|
||||
NUT_COMMANDS,
|
||||
NUT_VARIABLES,
|
||||
UpnpSoapClient,
|
||||
UPNP_SERVICE_TYPES,
|
||||
UPNP_DEVICE_TYPES,
|
||||
} from './dlna/dlna.classes.upnp.js';
|
||||
|
||||
// Chromecast app IDs
|
||||
export { CHROMECAST_APPS } from './speaker/speaker.classes.chromecast.js';
|
||||
|
||||
// AirPlay features
|
||||
export { AIRPLAY_FEATURES } from './speaker/speaker.classes.airplay.js';
|
||||
UpsSnmpHandler,
|
||||
UPS_SNMP_OIDS,
|
||||
type ISnmpOptions,
|
||||
type ISnmpVarbind,
|
||||
type TSnmpValueType,
|
||||
type TNutStatusFlag,
|
||||
type INutUpsInfo,
|
||||
type INutVariable,
|
||||
type TDlnaTransportState,
|
||||
type TDlnaTransportStatus,
|
||||
type IDlnaPositionInfo,
|
||||
type IDlnaTransportInfo,
|
||||
type IDlnaMediaInfo,
|
||||
type IDlnaContentItem,
|
||||
type IDlnaBrowseResult,
|
||||
type TUpsBatteryStatus,
|
||||
type TUpsOutputSource,
|
||||
type TUpsTestResult,
|
||||
type IUpsSnmpStatus,
|
||||
} from './protocols/index.js';
|
||||
|
||||
// ============================================================================
|
||||
// Helpers
|
||||
// ============================================================================
|
||||
|
||||
export { withRetry, createRetryable, defaultRetryOptions } from './helpers/helpers.retry.js';
|
||||
export {
|
||||
isValidIp,
|
||||
@@ -86,56 +111,12 @@ export {
|
||||
countIpsInCidr,
|
||||
} from './helpers/helpers.iprange.js';
|
||||
|
||||
// All interfaces and types
|
||||
// ============================================================================
|
||||
// All Interfaces and Types
|
||||
// ============================================================================
|
||||
|
||||
export * from './interfaces/index.js';
|
||||
|
||||
// SNMP types
|
||||
export type {
|
||||
ISnmpOptions,
|
||||
ISnmpVarbind,
|
||||
TSnmpValueType,
|
||||
} from './snmp/snmp.classes.snmpprotocol.js';
|
||||
export type { ISnmpDeviceInfo } from './snmp/snmp.classes.snmpdevice.js';
|
||||
|
||||
// UPS types
|
||||
export type {
|
||||
TNutStatusFlag,
|
||||
INutUpsInfo,
|
||||
INutVariable,
|
||||
} from './ups/ups.classes.nutprotocol.js';
|
||||
export type {
|
||||
TUpsBatteryStatus,
|
||||
TUpsOutputSource,
|
||||
IUpsSnmpStatus,
|
||||
} from './ups/ups.classes.upssnmp.js';
|
||||
export type {
|
||||
TUpsStatus,
|
||||
TUpsProtocol,
|
||||
IUpsDeviceInfo,
|
||||
IUpsBatteryInfo,
|
||||
IUpsPowerInfo,
|
||||
IUpsFullStatus,
|
||||
} from './ups/ups.classes.upsdevice.js';
|
||||
|
||||
// DLNA types
|
||||
export type {
|
||||
TDlnaTransportState,
|
||||
TDlnaTransportStatus,
|
||||
IDlnaPositionInfo,
|
||||
IDlnaTransportInfo,
|
||||
IDlnaMediaInfo,
|
||||
IDlnaContentItem,
|
||||
IDlnaBrowseResult,
|
||||
} from './dlna/dlna.classes.upnp.js';
|
||||
export type {
|
||||
IDlnaRendererInfo,
|
||||
IDlnaPlaybackState,
|
||||
} from './dlna/dlna.classes.renderer.js';
|
||||
export type {
|
||||
IDlnaServerInfo,
|
||||
IDlnaServerStats,
|
||||
} from './dlna/dlna.classes.server.js';
|
||||
|
||||
// SSDP types
|
||||
export type {
|
||||
ISsdpDevice,
|
||||
@@ -143,26 +124,3 @@ export type {
|
||||
ISsdpService,
|
||||
ISsdpIcon,
|
||||
} from './discovery/discovery.classes.ssdp.js';
|
||||
|
||||
// Speaker types
|
||||
export type {
|
||||
TSpeakerProtocol,
|
||||
TPlaybackState,
|
||||
ITrackInfo,
|
||||
IPlaybackStatus,
|
||||
ISpeakerInfo,
|
||||
} from './speaker/speaker.classes.speaker.js';
|
||||
export type {
|
||||
ISonosZoneInfo,
|
||||
ISonosSpeakerInfo,
|
||||
} from './speaker/speaker.classes.sonos.js';
|
||||
export type {
|
||||
IAirPlaySpeakerInfo,
|
||||
IAirPlayPlaybackInfo,
|
||||
} from './speaker/speaker.classes.airplay.js';
|
||||
export type {
|
||||
TChromecastType,
|
||||
IChromecastSpeakerInfo,
|
||||
IChromecastMediaMetadata,
|
||||
IChromecastMediaStatus,
|
||||
} from './speaker/speaker.classes.chromecast.js';
|
||||
|
||||
Reference in New Issue
Block a user