mqtt-ingest draft

This commit is contained in:
Nikita Bizyaev
2026-06-04 14:40:18 +03:00
commit e7b44539ae
27 changed files with 1492 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { parseUtf8 } from '../helpers/parse.js'
import { isNonEmptyString } from '../helpers/validate.js'
import type { TopicHandler } from '../types.js'
export const TOPIC = 'poc/topic3'
export const handleTopic3: TopicHandler = async (topic, payload) => {
const text = parseUtf8(payload)
if (!isNonEmptyString(text)) {
console.warn('topic3.invalid_payload', { topic })
return
}
console.log('topic3.received', { topic, text })
}