0f7af70b90
Updated Docker configuration, refactored middleware for improved error handling, and restructured account, order, plan, profile, and support modules, including their routes, services, and validations. Enhanced email processing queues and utilities for token generation, pagination, and response management to streamline the application architecture and enhance maintainability.
188 lines
5.9 KiB
JavaScript
188 lines
5.9 KiB
JavaScript
export const accountSwaggerDocs = {
|
|
"/api/auth/sign-up": {
|
|
post: {
|
|
tags: ["account"],
|
|
summary: "Create new account",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
email: "user@gmail.com",
|
|
password: "password",
|
|
shopName: "User",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "account created successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/sign-in": {
|
|
post: {
|
|
tags: ["account"],
|
|
summary: "Sign In your account",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
email: "user@gmail.com",
|
|
password: "password",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "User signed in successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/verify-otp": {
|
|
put: {
|
|
tags: ["account"],
|
|
summary: "Verify OTP",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
email: "user@gmail.com",
|
|
otp: "654321",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "OTP verification successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/verify-link": {
|
|
put: {
|
|
tags: ["account"],
|
|
summary: "Verify Link",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
token: "dsakfjasdkj",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "Token verification successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/me": {
|
|
get: {
|
|
tags: ["account"],
|
|
summary: "Get me account",
|
|
description: "",
|
|
responses: {
|
|
200: { description: "account fetched successfully" },
|
|
401: { description: "unauthorized" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/change-password": {
|
|
put: {
|
|
tags: ["account"],
|
|
summary: "Change Password",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
oldPassword: "123456",
|
|
newPassword: "654321",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "Passwrod change successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/resend-otp": {
|
|
put: {
|
|
tags: ["account"],
|
|
summary: "Resend OTP",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
email: "user@gmail.com",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "OTP resend successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/forget-password": {
|
|
put: {
|
|
tags: ["account"],
|
|
summary: "Forget Password",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
email: "user@gmail.com",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "Forget password successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
"/api/auth/reset-password": {
|
|
put: {
|
|
tags: ["account"],
|
|
summary: "Reset Password",
|
|
description: "",
|
|
requestBody: {
|
|
required: true,
|
|
content: {
|
|
"application/json": {
|
|
example: JSON.stringify({
|
|
token: "dkfjadskfds",
|
|
newPass: "newpass",
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
responses: {
|
|
201: { description: "Password reset successfully" },
|
|
500: { description: "Validation error or internal server error" },
|
|
},
|
|
},
|
|
},
|
|
};
|