UNPKG

dt-common-device

Version:

A secure and robust device management library for IoT applications

45 lines (44 loc) 1.22 kB
import { IInternalEvent } from "./interfaces/IInternalEvent"; export declare enum InternalEventType { HEARTBEAT = "heartbeat", SCHEDULE_CREATE = "schedule.create", SCHEDULE_UPDATE = "schedule.update", SCHEDULE_DELETE = "schedule.delete", SERVICE_DOWN = "service.down" } export declare class InternalEventSubscription { private readonly internalEventHandler; private readonly sqsQueueUrl; private readonly reservationSqsQueueUrl; private readonly heartbeatSqsQueueUrl; private readonly issueSqsQueueUrl; private readonly logger; private readonly isInitialized; private isSubscribed; constructor(internalEventHandler: IInternalEvent); private handleMessage; /** * Safely call handler methods with error handling */ private safeCallHandler; /** * Subscribe to SQS events */ subscribe(): Promise<void>; /** * Unsubscribe from SQS events */ unsubscribe(): Promise<void>; /** * Get subscription status */ getStatus(): { isInitialized: boolean; isSubscribed: boolean; sqsUrl: string; }; /** * Check if subscription is ready */ isReady(): boolean; }