Add Swagger docs at /docs and /openapi.json; frontend and backend updates

Made-with: Cursor
This commit is contained in:
SatsFaucet
2026-03-01 01:24:51 +01:00
parent bdb4892014
commit 381597c96f
20 changed files with 1214 additions and 98 deletions

View File

@@ -0,0 +1,48 @@
/** User API paths (auth required: JWT or NIP-98) */
const paths: Record<string, Record<string, unknown>> = {
"/user/refresh-profile": {
post: {
tags: ["User"],
summary: "Refresh Nostr profile",
description:
"Fetch Nostr profile (kind 0) and return cached lightning_address and name. Pre-fills the frontend and stores in DB.",
security: [{ BearerAuth: [] }, { Nostr: [] }],
responses: {
"200": {
description: "Profile refreshed",
content: {
"application/json": {
schema: { $ref: "#/components/schemas/RefreshProfileResponse" },
},
},
},
"401": {
description: "Unauthorized",
content: {
"application/json": {
schema: { $ref: "#/components/schemas/ErrorResponse" },
},
},
},
"429": {
description: "Rate limited",
content: {
"application/json": {
schema: { $ref: "#/components/schemas/RateLimitedResponse" },
},
},
},
"500": {
description: "Profile fetch failed",
content: {
"application/json": {
schema: { $ref: "#/components/schemas/ErrorResponse" },
},
},
},
},
},
},
};
export default paths;