feat(03-01): GEO-02 server half both directions — chat-keyboard fallback + GET /api/location + POST /api/location-fallback (claim-scoped)
- handlers/location-fallback.ts: requestLocationFallback (ReplyKeyboardMarkup request_location:true copy from strings.ts), recordSharedPin, registerLocationFallback (filters message.location, T-03-03) - strings.ts: awaitingPin/shareLocationButton/pinReceived in en+ms (CS1 parity) — all bot copy stays in strings.ts - bot.ts: createBot threads env.chat_sessions into the fallback handler; optional client fetch seam for tests; one-caller rule documented - webhook.ts: GET /api/location relay + POST /api/location-fallback trigger, both resolve chat_id & locale from getClaimByToken CLAIM, never client input (T-03-01/26/27); telegram-send failure is category-only 502 (T-03-28) - location-pin.test.mjs: LP1–LP14 (TTL contract, range guard, cross-user isolation both routes, locale split); LP12/LP13 patch node-fetch's cached default (grammy's node shim transport), then restore - CS4 scope untouched (handlers/ not scanned); CS1 parity automatic
This commit is contained in:
@@ -28,6 +28,13 @@ export interface BotStrings {
|
||||
/** D-03: lists only commands that exist in this phase — derived lines
|
||||
* ("cmd — description") feed the setMyCommands registration script. */
|
||||
helpMenu: string;
|
||||
/** GEO-02: chat-keyboard fallback prompt — bot tells the user to share a pin. */
|
||||
awaitingPin: string;
|
||||
/** GEO-02: the reply-keyboard button label (request_location: true). */
|
||||
shareLocationButton: string;
|
||||
/** GEO-02: confirmation after the user's shared pin has been recorded
|
||||
* in the TTL-only location-pin KV (GEO-03). */
|
||||
pinReceived: string;
|
||||
}
|
||||
|
||||
export type Locale = "en" | "ms";
|
||||
@@ -42,6 +49,9 @@ export const strings: Record<Locale, BotStrings> = {
|
||||
"What araharah never keeps: your location, your routes, your trip history, any profile about you.",
|
||||
helpMenu:
|
||||
"Commands:\n/help — How araharah works and what it keeps\n/privacy — What araharah stores and never stores",
|
||||
awaitingPin: "Send me a pin in this chat and I'll use it as your starting point.",
|
||||
shareLocationButton: "Share my location",
|
||||
pinReceived: "Got it — your starting point is set.",
|
||||
},
|
||||
ms: {
|
||||
startIntro:
|
||||
@@ -52,6 +62,9 @@ export const strings: Record<Locale, BotStrings> = {
|
||||
"Yang araharah tidak pernah simpan: lokasi anda, laluan anda, sejarah perjalanan anda, apa-apa profil tentang anda.",
|
||||
helpMenu:
|
||||
"Arahan:\n/help — Cara araharah berfungsi dan apa yang ia simpan\n/privacy — Apa yang araharah simpan dan tidak pernah simpan",
|
||||
awaitingPin: "Hantar saya pin dalam chat ini dan saya akan gunakannya sebagai titik mula anda.",
|
||||
shareLocationButton: "Kongsi lokasi saya",
|
||||
pinReceived: "Baik — titik mula anda sudah ditetapkan.",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user