- cari.ts: /cari + /search twin, 128-char pre-search cap (T-04-21), honest no-match refusal (D-13), single sendVenue card with inline OPEN + alternates - deep-link carrier corrected per RESEARCH Pitfall 1: web_app button URL carries ?dest=<plain slug id> — WebAppInfo has only a url field; no crypto - origin from configured MINI_APP_URL only (never user input); blank origin omits the OPEN button instead of guessing (T-04-30) - strings.ts: searchUsage/searchNoMatch/searchQueryTooLong/searchOpenButton/ osmAttribution in en+ms; helpMenu gains the /cari line in both locales - category-only logging law (D-15): four literal rejection categories, query never logged; success path logs nothing - config: MINI_APP_URL in Env + wrangler vars (public, not secret) + .dev.vars.example + docs/CONFIGURATION.md row and sections - bot deps gain @araharah/search (workspace link)
18 lines
1009 B
TypeScript
18 lines
1009 B
TypeScript
// Typed Env contract for the araharah bot Worker (D-10/D-11).
|
|
// Secrets (D-15) are wrangler secrets / .dev.vars mirrors — never committed (D-17).
|
|
|
|
export interface Env {
|
|
BOT_TOKEN: string; // wrangler secret (D-15) — Telegram Bot API token from @BotFather
|
|
// WEBHOOK_SECRET MUST be a non-empty secret (D-15) — /telegram/webhook
|
|
// fails closed at request time when missing/empty (WR-02), refusing all
|
|
// deliveries rather than letting grammY's secret check degrade to
|
|
// accept-everything.
|
|
WEBHOOK_SECRET: string; // wrangler secret (D-15) — value Telegram echoes in X-Telegram-Bot-Api-Secret-Token
|
|
chat_sessions: KVNamespace; // TTL-only namespace — first durable KV namespace (PRIV-02)
|
|
// The deployed Mini App ORIGIN (public, not a secret) — used to build the
|
|
// OPEN button's deep link. NOT derived from user input: the deep-link
|
|
// origin is a configured value (RESEARCH §Security V4 — an unvalidated
|
|
// origin would be an open redirect).
|
|
MINI_APP_URL: string;
|
|
}
|