{"openapi":"3.0.0","info":{"version":"0.3.0","title":"API.OLUWASETEMI.DEV","description":"List of APIs for learning, teaching, and for fun. I have tasks(todos), analytics, authentication(standalone and better-auth) and more in the pipeline - products, posts, etc."},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{},"parameters":{}},"paths":{"/tasks/me":{"get":{"tags":["Tasks"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"required":false,"name":"priority","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of authenticated user's tasks","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}}]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/tasks":{"get":{"tags":["Tasks"],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"required":false,"name":"priority","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of tasks","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}}]}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"post":{"tags":["Tasks"],"requestBody":{"description":"The task to create","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","nullable":true,"maxLength":1000},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"}},"required":["name","status"]}}}},"responses":{"200":{"description":"The created task","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["name"],"message":"Invalid input: expected string, received undefined"},{"code":"invalid_type","path":["status"],"message":"Invalid input: expected nonoptional, received undefined"}]}}},"required":["success","error"]}}}}}}},"/tasks/{id}":{"get":{"tags":["Tasks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The requested task","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"patch":{"tags":["Tasks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"The task updates","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","nullable":true,"maxLength":1000},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"}}}}}},"responses":{"200":{"description":"The updated task","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}}}},"401":{"description":"Authentication required to update this task","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"403":{"description":"You can only update tasks you own","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["fieldName"],"message":"Expected string, received undefined"}]}}},"required":["success","error"]},{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}]}}}}}},"delete":{"tags":["Tasks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Default task removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}},"204":{"description":"Task deleted"},"401":{"description":"Authentication required to delete this task","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"403":{"description":"You can only delete tasks you own","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/tasks/{id}/children":{"get":{"tags":["Tasks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"}],"responses":{"200":{"description":"List of children tasks","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"format":"date"},"end":{"type":"string","nullable":true,"format":"date"},"duration":{"type":"number","nullable":true},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","DONE","CANCELLED"]},"archived":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"parentId":{"type":"string","nullable":true},"children":{"type":"string"},"owner":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","start","end","duration","priority","status","archived","isDefault","parentId","children","owner","tags","completedAt","createdAt","updatedAt"]}}]}}}}}}},"/products/me":{"get":{"tags":["Products"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"featured","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"published","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of authenticated user's products","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number"},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","price","compareAtPrice","sku","barcode","quantity","category","tags","images","featured","published","isDefault","owner","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number"},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","price","compareAtPrice","sku","barcode","quantity","category","tags","images","featured","published","isDefault","owner","createdAt","updatedAt"]}}]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/products":{"get":{"tags":["Products"],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"featured","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"published","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of products","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number"},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","price","compareAtPrice","sku","barcode","quantity","category","tags","images","featured","published","isDefault","owner","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number"},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","price","compareAtPrice","sku","barcode","quantity","category","tags","images","featured","published","isDefault","owner","createdAt","updatedAt"]}}]}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"post":{"tags":["Products"],"requestBody":{"description":"The product to create","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","nullable":true},"price":{"type":"number","minimum":0},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number","minimum":0},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true}},"required":["name","price"]}}}},"responses":{"200":{"description":"The created product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number"},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","price","compareAtPrice","sku","barcode","quantity","category","tags","images","featured","published","isDefault","owner","createdAt","updatedAt"]}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["name"],"message":"Invalid input: expected string, received undefined"},{"code":"invalid_type","path":["price"],"message":"Invalid input: expected number, received undefined"}]}}},"required":["success","error"]}}}}}}},"/products/{id}":{"get":{"tags":["Products"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The requested product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number"},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","price","compareAtPrice","sku","barcode","quantity","category","tags","images","featured","published","isDefault","owner","createdAt","updatedAt"]}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"patch":{"tags":["Products"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"The product updates","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","nullable":true},"price":{"type":"number","minimum":0},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number","minimum":0},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"The updated product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"compareAtPrice":{"type":"number","nullable":true},"sku":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"quantity":{"type":"number"},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"images":{"type":"string"},"featured":{"type":"boolean"},"published":{"type":"boolean"},"isDefault":{"type":"boolean","nullable":true},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","name","description","price","compareAtPrice","sku","barcode","quantity","category","tags","images","featured","published","isDefault","owner","createdAt","updatedAt"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"403":{"description":"Forbidden - You can only update your own products","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["fieldName"],"message":"Expected string, received undefined"}]}}},"required":["success","error"]},{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}]}}}}}},"delete":{"tags":["Products"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Product deleted"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"403":{"description":"Forbidden - You can only delete your own products","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/posts/me":{"get":{"tags":["Posts"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of authenticated user's posts","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}}]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/posts":{"get":{"tags":["Posts"],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of posts","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}}]}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"post":{"tags":["Posts"],"description":"Create a new post. The slug field is optional - if not provided, it will be auto-generated from the title. If a duplicate slug exists, a numeric suffix (-1, -2, etc.) will be appended.","requestBody":{"description":"The post to create","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"slug":{"type":"string","nullable":true},"content":{"type":"string","minLength":1},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true}},"required":["title","content"]}}}},"responses":{"200":{"description":"The created post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["title"],"message":"Invalid input: expected string, received undefined"},{"code":"invalid_type","path":["content"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/posts/{id}":{"get":{"tags":["Posts"],"description":"Get a post by ID or slug. First attempts to find by UUID, then falls back to slug if not found. This allows both /posts/{uuid} and /posts/{slug} to work.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"Post ID (UUID) or slug. Examples: '123e4567-e89b-12d3-a456-426614174000' or 'my-post-slug'","example":"123e4567-e89b-12d3-a456-426614174000"},"required":true,"description":"Post ID (UUID) or slug. Examples: '123e4567-e89b-12d3-a456-426614174000' or 'my-post-slug'","name":"id","in":"path"}],"responses":{"200":{"description":"The requested post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"patch":{"tags":["Posts"],"description":"Update a post. If the title is changed without providing a new slug, the slug will be auto-regenerated from the new title. Duplicate slugs will have numeric suffixes appended.","parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"The post updates","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"slug":{"type":"string","nullable":true},"content":{"type":"string","minLength":1},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"The updated post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"403":{"description":"Forbidden - You can only update your own posts","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["fieldName"],"message":"Expected string, received undefined"}]}}},"required":["success","error"]},{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}]}}}}}},"delete":{"tags":["Posts"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Post deleted"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"403":{"description":"Forbidden - You can only delete your own posts","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/posts/slug/{slug}":{"get":{"tags":["Posts"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"The requested post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string","nullable":true},"content":{"type":"string"},"excerpt":{"type":"string","nullable":true},"featuredImage":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string","nullable":true},"tags":{"type":"string","nullable":true},"viewCount":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date"},"isDefault":{"type":"boolean","nullable":true},"author":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","title","slug","content","excerpt","featuredImage","status","category","tags","viewCount","publishedAt","isDefault","author","createdAt","updatedAt"]}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid slug error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["slug"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/posts/{postId}/comments/me":{"get":{"tags":["Comments"],"security":[{"bearerAuth":[]}],"summary":"List my comments on a post","description":"Get all comments made by the authenticated user on a specific post","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"},{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"ASC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of authenticated user's comments on this post","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"postId":{"type":"string"},"content":{"type":"string"},"authorName":{"type":"string"},"authorEmail":{"type":"string","nullable":true},"authorId":{"type":"string","nullable":true},"isEdited":{"type":"boolean"},"editedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","postId","content","authorName","authorEmail","authorId","isEdited","editedAt","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"postId":{"type":"string"},"content":{"type":"string"},"authorName":{"type":"string"},"authorEmail":{"type":"string","nullable":true},"authorId":{"type":"string","nullable":true},"isEdited":{"type":"boolean"},"editedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","postId","content","authorName","authorEmail","authorId","isEdited","editedAt","createdAt","updatedAt"]}}]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Unauthorized"}}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}}}}},"/posts/{postId}/comments":{"get":{"tags":["Comments"],"summary":"List comments for a post","description":"Get all comments for a specific post with pagination and sorting support","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"},{"schema":{"type":"boolean","nullable":true,"default":false,"description":"Return all comments without pagination"},"required":false,"description":"Return all comments without pagination","name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page number for pagination"},"required":false,"description":"Page number for pagination","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of comments per page"},"required":false,"description":"Number of comments per page","name":"limit","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"ASC","description":"Sort order by creation date (ASC = oldest first, DESC = newest first)"},"required":false,"description":"Sort order by creation date (ASC = oldest first, DESC = newest first)","name":"sort","in":"query"}],"responses":{"200":{"description":"List of comments","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"postId":{"type":"string"},"content":{"type":"string"},"authorName":{"type":"string"},"authorEmail":{"type":"string","nullable":true},"authorId":{"type":"string","nullable":true},"isEdited":{"type":"boolean"},"editedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","postId","content","authorName","authorEmail","authorId","isEdited","editedAt","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"postId":{"type":"string"},"content":{"type":"string"},"authorName":{"type":"string"},"authorEmail":{"type":"string","nullable":true},"authorId":{"type":"string","nullable":true},"isEdited":{"type":"boolean"},"editedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","postId","content","authorName","authorEmail","authorId","isEdited","editedAt","createdAt","updatedAt"]}}]}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}}}},"post":{"tags":["Comments"],"summary":"Create a comment on a post","description":"Create a new comment. Can be anonymous (provide authorName) or authenticated (uses logged-in user info). If authenticated, user info takes precedence over submitted data.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"postId","in":"path"}],"requestBody":{"description":"The comment to create","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":10000},"authorName":{"type":"string","minLength":1,"maxLength":255},"authorEmail":{"anyOf":[{"type":"string","format":"email"},{"type":"string","enum":[""]},{"nullable":true}]}},"required":["content","authorName"]}}}},"responses":{"200":{"description":"The created comment","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"postId":{"type":"string"},"content":{"type":"string"},"authorName":{"type":"string"},"authorEmail":{"type":"string","nullable":true},"authorId":{"type":"string","nullable":true},"isEdited":{"type":"boolean"},"editedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","postId","content","authorName","authorEmail","authorId","isEdited","editedAt","createdAt","updatedAt"]}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["content"],"message":"Invalid input: expected string, received undefined"},{"code":"invalid_type","path":["authorName"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/comments/{id}":{"get":{"tags":["Comments"],"summary":"Get a specific comment","description":"Retrieve a single comment by its ID","parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The requested comment","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"postId":{"type":"string"},"content":{"type":"string"},"authorName":{"type":"string"},"authorEmail":{"type":"string","nullable":true},"authorId":{"type":"string","nullable":true},"isEdited":{"type":"boolean"},"editedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","postId","content","authorName","authorEmail","authorId","isEdited","editedAt","createdAt","updatedAt"]}}}},"404":{"description":"Comment not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}}}},"patch":{"tags":["Comments"],"summary":"Update a comment","description":"Update a comment. Authentication required. Users can only update their own comments. Sets isEdited flag and editedAt timestamp.","parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"The comment updates (content only)","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":10000}}}}}},"responses":{"200":{"description":"The updated comment","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"postId":{"type":"string"},"content":{"type":"string"},"authorName":{"type":"string"},"authorEmail":{"type":"string","nullable":true},"authorId":{"type":"string","nullable":true},"isEdited":{"type":"boolean"},"editedAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","postId","content","authorName","authorEmail","authorId","isEdited","editedAt","createdAt","updatedAt"]}}}},"401":{"description":"Authentication required to update comments","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Unauthorized"}}}}},"403":{"description":"Forbidden - You can only update your own comments","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Forbidden"}}}}},"404":{"description":"Comment not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["fieldName"],"message":"Expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"delete":{"tags":["Comments"],"summary":"Delete a comment","description":"Delete a comment. Authentication required. Users can only delete their own comments.","parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Comment deleted successfully"},"401":{"description":"Authentication required to delete comments","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Unauthorized"}}}}},"403":{"description":"Forbidden - You can only delete your own comments","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Forbidden"}}}}},"404":{"description":"Comment not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}}}}},"/analytics/requests":{"get":{"tags":["Analytics"],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"method","in":"query"},{"schema":{"type":"string"},"required":false,"name":"path","in":"query"},{"schema":{"type":"integer","minimum":100,"maximum":599},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Paginated list of request analytics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"status":{"type":"number"},"durationMs":{"type":"number"},"createdAt":{"type":"string","nullable":true,"format":"date"},"ip":{"type":"string","nullable":true},"userAgent":{"type":"string","nullable":true},"referer":{"type":"string","nullable":true}},"required":["id","method","path","status","durationMs","createdAt","ip","userAgent","referer"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]}}}},"422":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["fieldName"],"message":"Expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/analytics/counts":{"get":{"tags":["Analytics"],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"path","in":"query"},{"schema":{"type":"string"},"required":false,"name":"method","in":"query"},{"schema":{"type":"string","enum":["day","path","method"]},"required":false,"name":"groupBy","in":"query"}],"responses":{"200":{"description":"Aggregated request counts","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"number"}},"required":["key","count"]}},"groupedBy":{"type":"string","enum":["day","path","method"]}},"required":["total"]}}}},"422":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["fieldName"],"message":"Expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/auth/register":{"post":{"tags":["Auth"],"description":"Register a new user","summary":"Register a new user","requestBody":{"description":"User registration data","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":255,"format":"email"},"name":{"type":"string","minLength":1,"maxLength":255},"password":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"emailVerified":{"type":"boolean"},"isActive":{"type":"boolean"},"lastLoginAt":{"type":"string","nullable":true,"format":"date"}},"required":["email","name"]}}}},"responses":{"201":{"description":"User registered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"image":{"type":"string","nullable":true},"emailVerified":{"type":"boolean"},"isActive":{"type":"boolean"},"lastLoginAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","email","name","image","emailVerified","isActive","lastLoginAt","createdAt","updatedAt"]},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["user","accessToken","refreshToken"]}}}},"409":{"description":"Email already exists","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Email already exists"}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Validation error"}}}}}}}},"/auth/login":{"post":{"tags":["Auth"],"description":"Login a user","summary":"Login user","requestBody":{"description":"User login credentials","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":1}},"required":["email","password"]}}}},"responses":{"200":{"description":"User logged in successfully","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"image":{"type":"string","nullable":true},"emailVerified":{"type":"boolean"},"isActive":{"type":"boolean"},"lastLoginAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","email","name","image","emailVerified","isActive","lastLoginAt","createdAt","updatedAt"]},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["user","accessToken","refreshToken"]}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Invalid credentials"}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Validation error"}}}}}}}},"/auth/refresh":{"post":{"tags":["Auth"],"description":"Refresh access token","summary":"Refresh access token","requestBody":{"description":"Refresh token","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refreshToken":{"type":"string"}},"required":["refreshToken"]}}}},"responses":{"200":{"description":"Token refreshed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}},"required":["accessToken","refreshToken"]}}}},"401":{"description":"Invalid refresh token","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Invalid refresh token"}}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Validation error"}}}}}}}},"/auth/me":{"get":{"tags":["Auth"],"description":"Get current user profile","summary":"Get current user profile","responses":{"200":{"description":"Current user profile","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"image":{"type":"string","nullable":true},"emailVerified":{"type":"boolean"},"isActive":{"type":"boolean"},"lastLoginAt":{"type":"string","nullable":true,"format":"date"},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","email","name","image","emailVerified","isActive","lastLoginAt","createdAt","updatedAt"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Authentication required"}}}}}}}},"/webhooks/subscriptions":{"get":{"tags":["Webhooks"],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"active","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of webhook subscriptions","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"string"},"secret":{"type":"string"},"active":{"type":"boolean"},"maxRetries":{"type":"number"},"retryBackoff":{"type":"string"},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","url","events","secret","active","maxRetries","retryBackoff","owner","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"string"},"secret":{"type":"string"},"active":{"type":"boolean"},"maxRetries":{"type":"number"},"retryBackoff":{"type":"string"},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","url","events","secret","active","maxRetries","retryBackoff","owner","createdAt","updatedAt"]}}]}}}}}},"post":{"tags":["Webhooks"],"requestBody":{"description":"The webhook subscription to create","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"format":"uri"},"events":{"type":"string"},"active":{"type":"boolean"},"maxRetries":{"type":"number","minimum":0,"maximum":10},"retryBackoff":{"type":"string"},"owner":{"type":"string","nullable":true}},"required":["url","events"]}}}},"responses":{"200":{"description":"The created webhook subscription","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"string"},"secret":{"type":"string"},"active":{"type":"boolean"},"maxRetries":{"type":"number"},"retryBackoff":{"type":"string"},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","url","events","secret","active","maxRetries","retryBackoff","owner","createdAt","updatedAt"]}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["url"],"message":"Invalid input: expected string, received undefined"},{"code":"invalid_type","path":["events"],"message":"Invalid input: expected nonoptional, received undefined"}]}}},"required":["success","error"]}}}}}}},"/webhooks/subscriptions/{id}":{"get":{"tags":["Webhooks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The requested webhook subscription","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"string"},"secret":{"type":"string"},"active":{"type":"boolean"},"maxRetries":{"type":"number"},"retryBackoff":{"type":"string"},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","url","events","secret","active","maxRetries","retryBackoff","owner","createdAt","updatedAt"]}}}},"403":{"description":"Forbidden - You can only view your own webhook subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"404":{"description":"Webhook subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}},"patch":{"tags":["Webhooks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"The webhook subscription updates","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"format":"uri"},"events":{"type":"string"},"active":{"type":"boolean"},"maxRetries":{"type":"number","minimum":0,"maximum":10},"retryBackoff":{"type":"string"},"owner":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"The updated webhook subscription","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"string"},"secret":{"type":"string"},"active":{"type":"boolean"},"maxRetries":{"type":"number"},"retryBackoff":{"type":"string"},"owner":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","url","events","secret","active","maxRetries","retryBackoff","owner","createdAt","updatedAt"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"403":{"description":"Forbidden - You can only update your own webhook subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"404":{"description":"Webhook subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"The validation error(s)","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["fieldName"],"message":"Expected string, received undefined"}]}}},"required":["success","error"]},{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}]}}}}}},"delete":{"tags":["Webhooks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Webhook subscription deleted"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"403":{"description":"Forbidden - You can only delete your own webhook subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"404":{"description":"Webhook subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/webhooks/subscriptions/{id}/test":{"post":{"tags":["Webhooks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Test result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"statusCode":{"type":"number"},"responseTime":{"type":"number"}},"required":["success","message"]}}}},"404":{"description":"Webhook subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/webhooks/events":{"get":{"tags":["Webhooks"],"parameters":[{"schema":{"type":"boolean","nullable":true,"default":false},"required":false,"name":"all","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"subscriptionId","in":"query"},{"schema":{"type":"string","enum":["pending","delivered","failed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["ASC","DESC"],"default":"DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of webhook events","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subscriptionId":{"type":"string"},"eventType":{"type":"string"},"payload":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"number"},"lastAttempt":{"type":"string","nullable":true,"format":"date"},"nextRetry":{"type":"string","nullable":true,"format":"date"},"responseCode":{"type":"number","nullable":true},"responseBody":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","subscriptionId","eventType","payload","status","attempts","lastAttempt","nextRetry","responseCode","responseBody","errorMessage","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["total","page","limit","totalPages","hasNextPage","hasPreviousPage"]}},"required":["data","meta"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subscriptionId":{"type":"string"},"eventType":{"type":"string"},"payload":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"number"},"lastAttempt":{"type":"string","nullable":true,"format":"date"},"nextRetry":{"type":"string","nullable":true,"format":"date"},"responseCode":{"type":"number","nullable":true},"responseBody":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date"},"updatedAt":{"type":"string","nullable":true,"format":"date"}},"required":["id","subscriptionId","eventType","payload","status","attempts","lastAttempt","nextRetry","responseCode","responseBody","errorMessage","createdAt","updatedAt"]}}]}}}}}}},"/webhooks/events/{id}/retry":{"post":{"tags":["Webhooks"],"parameters":[{"schema":{"type":"string","format":"uuid","required":["id"],"example":"4651e634-a530-4484-9b09-9616a28f35e3"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Retry initiated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}},"404":{"description":"Webhook event not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"example":{"message":"Not Found"}}}}},"422":{"description":"Invalid id error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}},"name":{"type":"string"}},"required":["issues","name"],"example":{"name":"ZodError","issues":[{"code":"invalid_type","path":["id"],"message":"Invalid input: expected string, received undefined"}]}}},"required":["success","error"]}}}}}}},"/sse/tasks":{"get":{"tags":["SSE"],"summary":"Stream task events via Server-Sent Events","description":"Real-time stream of task creation, updates, and deletions. Supports optional authentication to filter events by user.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Optional task ID to subscribe to specific task updates","example":"550e8400-e29b-41d4-a716-446655440000"},"required":false,"description":"Optional task ID to subscribe to specific task updates","name":"taskId","in":"query"}],"responses":{"200":{"description":"SSE stream of task events","content":{"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events stream"}}}}}}},"/sse/products":{"get":{"tags":["SSE"],"summary":"Stream product events via Server-Sent Events","description":"Real-time stream of product creation, updates, and deletions. Supports optional authentication to filter events by user.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Optional product ID to subscribe to specific product updates","example":"550e8400-e29b-41d4-a716-446655440000"},"required":false,"description":"Optional product ID to subscribe to specific product updates","name":"productId","in":"query"}],"responses":{"200":{"description":"SSE stream of product events","content":{"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events stream"}}}}}}},"/sse/posts":{"get":{"tags":["SSE"],"summary":"Stream post events via Server-Sent Events","description":"Real-time stream of post creation, updates, deletions, and publishing. Supports optional authentication to filter events by user.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Optional post ID to subscribe to specific post updates","example":"550e8400-e29b-41d4-a716-446655440000"},"required":false,"description":"Optional post ID to subscribe to specific post updates","name":"postId","in":"query"}],"responses":{"200":{"description":"SSE stream of post events","content":{"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events stream"}}}}}}},"/sse/comments":{"get":{"tags":["SSE"],"summary":"Stream comment events via Server-Sent Events","description":"Real-time stream of comment creation, updates, and deletions. Supports optional filtering by post ID, comment ID, and user authentication.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Optional post ID to subscribe to comments on a specific post","example":"550e8400-e29b-41d4-a716-446655440000"},"required":false,"description":"Optional post ID to subscribe to comments on a specific post","name":"postId","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Optional comment ID to subscribe to specific comment updates","example":"550e8400-e29b-41d4-a716-446655440000"},"required":false,"description":"Optional comment ID to subscribe to specific comment updates","name":"commentId","in":"query"}],"responses":{"200":{"description":"SSE stream of comment events","content":{"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events stream"}}}}}}}}}