mirror of
https://github.com/tiennm99/claude-status-webhook.git
synced 2026-04-18 05:20:41 +00:00
feat: structured logging, JSDoc types, and WEBHOOK_SECRET guard
- Replace string-interpolated console.log/error with JSON.stringify for searchable/filterable CF Workers dashboard logs - Add shared JSDoc typedefs (Subscriber, QueueMessage, ChatTarget) with @param/@returns annotations on key functions - Guard against undefined WEBHOOK_SECRET env var (auth bypass on misconfigured deploy) - Add 3 declined features to feature-decisions.md (fan-out decoupling, idempotency keys, /ping)
This commit is contained in:
21
src/types.js
Normal file
21
src/types.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Shared JSDoc type definitions for the project.
|
||||
* Import via: @import { Subscriber, QueueMessage, ChatTarget } from "./types.js"
|
||||
*/
|
||||
|
||||
/**
|
||||
* Subscriber preferences stored in KV value and metadata
|
||||
* @typedef {{ types: string[], components: string[] }} Subscriber
|
||||
*/
|
||||
|
||||
/**
|
||||
* Message body enqueued to CF Queue for fan-out delivery
|
||||
* @typedef {{ chatId: number, threadId: ?number, html: string }} QueueMessage
|
||||
*/
|
||||
|
||||
/**
|
||||
* Chat target extracted from Telegram update
|
||||
* @typedef {{ chatId: number, threadId: ?number }} ChatTarget
|
||||
*/
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user