Add Pennyzo API status checker scripts, report viewer, and documentation

This commit is contained in:
2025-09-25 14:11:36 +05:30
parent df2a2b9412
commit aece15a286
16 changed files with 2291 additions and 6 deletions

101
scripts/SUMMARY.md Normal file
View File

@@ -0,0 +1,101 @@
# Pennyzo API Status Checker
This project provides comprehensive tools for checking the status of the Pennyzo General API endpoints. It includes both basic and extended versions of the API status checker, along with supporting tools and documentation.
## Project Structure
```
scripts/
├── api-status-checker.js # Basic API status checker
├── api-status-checker-extended.js # Extended API status checker with additional features
├── run-api-check.ps1 # PowerShell helper script
└── README.md # Documentation for the scripts
reports/
├── example-report.json # Sample report file
├── report-viewer.html # HTML tool for visualizing reports
├── .gitignore # Git configuration for reports
└── README.md # Documentation for the reports directory
```
## Features
1. **Basic API Status Checker**
- Tests both public and authenticated endpoints
- Colorful console output
- Automatic token management
2. **Extended API Status Checker**
- All features of the basic checker
- Saves detailed reports to JSON files
- Provides response time measurements
- Support for command line arguments
- Environment variable support for credentials
3. **Report Viewer**
- HTML-based visualization tool
- Interactive endpoint details
- Summary statistics
- Color-coded status indicators
4. **Helper Tools**
- PowerShell script for flexible execution
- npm scripts for convenient access
- Example report for reference
## Getting Started
### Using npm Scripts
```bash
# Run basic API check
npm run api:check
# Run extended API check with report generation
npm run api:check:extended
# Run extended API check with verbose output
npm run api:check:verbose
# Run extended API check with real credentials
npm run api:check:real
```
### Using Environment Variables
For secure credential management with real credentials:
```powershell
$env:PENNYZO_TEST_EMAIL = "your-test-email@example.com"
$env:PENNYZO_TEST_PASSWORD = "your-test-password"
npm run api:check:real
```
### Viewing Reports
After running the extended script, reports are saved to the `reports` directory. To view a report:
1. Open `reports/report-viewer.html` in a web browser
2. Click "Choose Report File" to select a JSON report
3. Review the report details
## Summary of API Endpoints Tested
### Public Endpoints
- GET `/system/health`
- GET `/registration/company/identity-rules`
### Authentication Flow
- POST `/auth/login`
### Authenticated Endpoints
- GET `/auth/me`
- GET `/users/profile`
- GET `/users/stats`
- GET `/users/membership-info`