feat: add nowcast point alarm page client with SQLite store
Adds point_alarm.py (flattening, secret masking, SQLite upsert store, paged fetch with 403 fallback, CSV/TXT export, shared filter loader), nowcast-point-page.py CLI and unit tests. Register will read the shared filter from nowcast-point-alarm-filter.json instead of repeating it in the CSV.
This commit is contained in:
+2
-7
@@ -18,6 +18,7 @@ from nowcast_common import (
|
||||
read_json_object,
|
||||
response_warnings,
|
||||
as_uuid,
|
||||
fetch_account_id,
|
||||
load_webhook_config,
|
||||
write_csv_atomic,
|
||||
)
|
||||
@@ -86,13 +87,7 @@ class GeoAlarmService:
|
||||
self.client = client
|
||||
|
||||
def get_account_id(self) -> str:
|
||||
response = self.client.request_json("GET", "/v1/users/me")
|
||||
data = response.data
|
||||
account = data.get("account") if isinstance(data, dict) else None
|
||||
account_id = account.get("id") if isinstance(account, dict) else None
|
||||
if not as_uuid(account_id):
|
||||
raise ApiError("/v1/users/me yanıtında geçerli account.id bulunamadı.")
|
||||
return account_id
|
||||
return fetch_account_id(self.client)
|
||||
|
||||
def list_cities(self) -> list[dict[str, Any]]:
|
||||
data = self.client.request_json(
|
||||
|
||||
Reference in New Issue
Block a user