diff options
| author | Fuwn <[email protected]> | 2026-02-07 02:00:59 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-07 02:00:59 -0800 |
| commit | f93bad7da47093a12116ff0f390abb548289b600 (patch) | |
| tree | e2a9debcca3473af8f293c3215704549e5bde17f /apps/web/app/reader/settings/_components/api-settings.tsx | |
| parent | style: format Go worker with iku (diff) | |
| download | asa.news-f93bad7da47093a12116ff0f390abb548289b600.tar.xz asa.news-f93bad7da47093a12116ff0f390abb548289b600.zip | |
style: lowercase all user-facing strings and add custom eslint rule
Comprehensive sweep of all user-facing text to enforce lowercase
convention, including acronyms (api, rest, http, opml, json, totp,
mfa, qr, hmac). Added asa-lowercase/lowercase-strings eslint rule
that reports uppercase in notify() calls, error messages, jsx text,
and checked attributes (placeholder, alt, title).
Diffstat (limited to 'apps/web/app/reader/settings/_components/api-settings.tsx')
| -rw-r--r-- | apps/web/app/reader/settings/_components/api-settings.tsx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/apps/web/app/reader/settings/_components/api-settings.tsx b/apps/web/app/reader/settings/_components/api-settings.tsx index cb69958..0ae6a8d 100644 --- a/apps/web/app/reader/settings/_components/api-settings.tsx +++ b/apps/web/app/reader/settings/_components/api-settings.tsx @@ -26,7 +26,7 @@ function useApiKeys() { queryKey: ["apiKeys"], queryFn: async () => { const response = await fetch("/api/v1/keys") - if (!response.ok) throw new Error("Failed to load API keys") + if (!response.ok) throw new Error("failed to load api keys") const data = await response.json() return data.keys as ApiKey[] }, @@ -44,7 +44,7 @@ function useCreateApiKey() { }) if (!response.ok) { const data = await response.json() - throw new Error(data.error || "Failed to create API key") + throw new Error(data.error || "failed to create api key") } return response.json() as Promise<{ fullKey: string @@ -67,7 +67,7 @@ function useRevokeApiKey() { }) if (!response.ok) { const data = await response.json() - throw new Error(data.error || "Failed to revoke API key") + throw new Error(data.error || "failed to revoke api key") } }, onSuccess: () => { @@ -81,7 +81,7 @@ function useWebhookConfig() { queryKey: ["webhookConfig"], queryFn: async () => { const response = await fetch("/api/webhook-config") - if (!response.ok) throw new Error("Failed to load webhook config") + if (!response.ok) throw new Error("failed to load webhook config") return response.json() as Promise<WebhookConfiguration> }, }) @@ -104,7 +104,7 @@ function useUpdateWebhookConfig() { }) if (!response.ok) { const data = await response.json() - throw new Error(data.error || "Failed to update webhook config") + throw new Error(data.error || "failed to update webhook config") } }, onSuccess: () => { @@ -121,7 +121,7 @@ function useTestWebhook() { }) if (!response.ok) { const data = await response.json() - throw new Error(data.error || "Failed to send test webhook") + throw new Error(data.error || "failed to send test webhook") } return response.json() as Promise<{ delivered: boolean @@ -147,7 +147,7 @@ function ApiKeysSection() { onSuccess: (data) => { setRevealedKey(data.fullKey) setNewKeyLabel("") - notify("API key created") + notify("api key created") }, onError: (error: Error) => { notify(error.message) @@ -158,14 +158,14 @@ function ApiKeysSection() { function handleCopyKey() { if (revealedKey) { navigator.clipboard.writeText(revealedKey) - notify("API key copied to clipboard") + notify("api key copied to clipboard") } } function handleRevokeKey(keyIdentifier: string) { revokeApiKey.mutate(keyIdentifier, { onSuccess: () => { - notify("API key revoked") + notify("api key revoked") setConfirmRevokeIdentifier(null) }, onError: (error: Error) => { @@ -176,9 +176,9 @@ function ApiKeysSection() { return ( <div className="mb-6"> - <h3 className="mb-2 text-text-primary">API keys</h3> + <h3 className="mb-2 text-text-primary">api keys</h3> <p className="mb-3 text-text-dim"> - use API keys to authenticate requests to the REST API + use api keys to authenticate requests to the rest api </p> {revealedKey && ( @@ -379,12 +379,12 @@ function WebhookSection() { <div className="mb-6"> <h3 className="mb-2 text-text-primary">webhooks</h3> <p className="mb-3 text-text-dim"> - receive HTTP POST notifications when new entries arrive in your + receive http post notifications when new entries arrive in your subscribed feeds </p> <div className="mb-4"> - <label className="mb-1 block text-text-secondary">webhook URL</label> + <label className="mb-1 block text-text-secondary">webhook url</label> <input type="url" value={webhookUrl} @@ -409,7 +409,7 @@ function WebhookSection() { setWebhookSecret(event.target.value) setHasUnsavedChanges(true) }} - placeholder="optional HMAC-SHA256 signing secret" + placeholder="optional hmac-sha256 signing secret" className="min-w-0 flex-1 border border-border bg-background-primary px-3 py-1.5 text-text-primary outline-none placeholder:text-text-dim focus:border-text-dim" /> <button @@ -479,21 +479,21 @@ export function ApiSettings() { const { data: userProfile, isLoading } = useUserProfile() if (isLoading) { - return <p className="px-4 py-6 text-text-dim">loading API settings ...</p> + return <p className="px-4 py-6 text-text-dim">loading api settings ...</p> } if (!userProfile) { return ( - <p className="px-4 py-6 text-text-dim">failed to load API settings</p> + <p className="px-4 py-6 text-text-dim">failed to load api settings</p> ) } if (userProfile.tier !== "developer") { return ( <div className="px-4 py-3"> - <h3 className="mb-2 text-text-primary">developer API</h3> + <h3 className="mb-2 text-text-primary">developer api</h3> <p className="mb-3 text-text-dim"> - the developer plan includes a read-only REST API and webhook push + the developer plan includes a read-only rest api and webhook push notifications. upgrade to developer to access these features. </p> </div> @@ -506,22 +506,22 @@ export function ApiSettings() { <WebhookSection /> <div> - <h3 className="mb-2 text-text-primary">API documentation</h3> + <h3 className="mb-2 text-text-primary">api documentation</h3> <p className="mb-3 text-text-dim"> - authenticate requests with an API key in the Authorization header: + authenticate requests with an api key in the authorization header: </p> <code className="block bg-background-tertiary px-3 py-2 text-text-secondary"> Authorization: Bearer asn_your_key_here </code> <div className="mt-3 space-y-1 text-text-dim"> - <p>GET /api/v1/profile — your account info and limits</p> - <p>GET /api/v1/feeds — your subscribed feeds</p> - <p>GET /api/v1/folders — your folders</p> + <p>get /api/v1/profile — your account info and limits</p> + <p>get /api/v1/feeds — your subscribed feeds</p> + <p>get /api/v1/folders — your folders</p> <p> - GET /api/v1/entries — entries with ?cursor, ?limit, ?feedIdentifier, + get /api/v1/entries — entries with ?cursor, ?limit, ?feedIdentifier, ?readStatus, ?savedStatus filters </p> - <p>GET /api/v1/entries/:id — single entry with full content</p> + <p>get /api/v1/entries/:id — single entry with full content</p> </div> </div> </div> |