dt-common-device
Version:
A secure and robust device management library for IoT applications
33 lines (32 loc) • 1.07 kB
TypeScript
export interface IWebhookQueue {
/**
* Add a webhook to the appropriate queue based on propertyId and pmsType
*/
addWebhookToQueue(propertyId: string, pmsType: string, webhookData: any, options?: any): Promise<string>;
/**
* Mark a webhook job as completed (processed successfully)
*/
markWebhookCompleted(propertyId: string, pmsType: string, jobId: string): Promise<void>;
/**
* Mark a webhook job as failed
*/
markWebhookFailed(propertyId: string, pmsType: string, jobId: string, error?: string): Promise<void>;
/**
* Poll available webhook from ANY available webhook queue in Redis
*/
pollWebhookFromQueues(): Promise<{
jobId: string;
data: any;
propertyId: string;
pmsType: string;
queueName: string;
} | null>;
/**
* Get all available webhook queue names from Redis
*/
getAllQueueNames(): Promise<string[]>;
/**
* Get total waiting count across all webhook queues
*/
getTotalWaitingCount(): Promise<number>;
}