vascomm-library-code
v1.5.0
Published
Vascomm Library Code
Readme
My Next.js API Handlers Package
This package provides handlers for Next.js API routes, along with utility functions for managing error and response codes.
Installation
To install this package, you can use npm:
npm install my-nextjs-package
### Error Codes
| Error Code | Message |
| ---------------- | --------------------------|
| `DUP_DATA` | Data duplicated |
| `NO_CHANGE` | No data changed |
| `EXIST_DATA` | Data already exists |
| `CRED_ERROR` | Credential missmatch |
| `DATA_LARGE` | Data too large |
| `PAY_FAIL` | Payment failed |
| `INV_TRANS` | Invalid transaction |
| `BLOCKED` | User or data blocked |
| `REJ_DATA` | Data rejected |
| `EXPIRED` | Expired |
| `MISS_KEY` | Missing key |
| `EXT_API_ERR` | Third party API failure |
| `MAX_LIMIT` | Reached max limit |
| `PROG_ERR` | Program code error |
| `METHOD_NOT_ALLOWED` | Method not allowd |
### Response Codes
|Request Code | Response Code | Description |
| ----------------- | --------------- | -------------------------------------------- |
| SUCCESS | `200` | Success |
| CREATED| `201` | Created |
| ACCEPTED | `202` | Accepted |
| NO_CONTENT | `204` | No Content |
| BAD_REQUEST | `400` | Bad Request |
| UNAUTHORIZED | `401` | Unauthorized |
| FORBIDDEN | `403` | Forbidden |
| NOT_FOUND | `404` | Not Found |
| INTERNAL_SERVER_ERROR | `500` | Internal Server Error |
| DATA_UPDATED | `200` | Data updated |
## Contribution
If you find any issues or have suggestions for improvements, please open an [issue](https://github.com/randykarusnian/my-nextjs-package/issues) or submit a pull request. We welcome contributions from the community!
## License
This project is licensed under the [MIT License](LICENSE). See the [LICENSE](LICENSE) file for details.