Add Swagger docs at /docs and /openapi.json; frontend and backend updates
Made-with: Cursor
This commit is contained in:
48
backend/src/openapi/paths/user.ts
Normal file
48
backend/src/openapi/paths/user.ts
Normal 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;
|
||||
Reference in New Issue
Block a user