[v0.8.3] Adjustments - CandlePilot TS Migration
This pull request updates the 4Hands API from version 0.8.2 to 0.8.3 and refactors several utility and response patterns throughout the codebase. The main focus is on removing custom object prototype extensions (like getSafe, toSuccess, and oid) in favor of explicit utility function usage and plain object responses. This improves maintainability, safety, and clarity. Additionally, there are minor dependency and middleware updates.
API and Utility Refactoring:
- Removed custom
Object.prototypemethods (getSafe,toSuccess,oid) fromsrc/global/index.jsand replaced their usage with utility functions (e.g.,getObjectPath,global.oid) throughout the codebase. This prevents prototype pollution and makes utility usage more explicit. [1] [2] [3] [4] [5] [6] [7] - Standardized success responses to plain objects with
{ success: true, ... }instead of using.toSuccess()method, improving consistency and making the response structure clearer. [1] [2] [3]
Dependency and Middleware Updates:
- Removed the
body-parserdependency and switched to usingexpress.json({ limit })directly insrc/services/ServerAPI/index.js, simplifying middleware usage. [1] [2]
Versioning and Documentation:
- Bumped the API version from 0.8.2 to 0.8.3 in
README.mdandpackage.jsonto reflect these changes. [1] [2]