paymongo-cli 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +95 -95
- package/.github/workflows/ci-cd.yml +2 -46
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/AGENTS.md +0 -1
- package/CHANGELOG.md +53 -2
- package/LICENSE +20 -20
- package/README.md +1 -1
- package/TESTING.md +1 -14
- package/dist/.tsbuildinfo +1 -1
- package/dist/commands/env.js +27 -3
- package/dist/commands/generate.js +977 -977
- package/dist/commands/init.js +27 -5
- package/dist/commands/login.js +27 -5
- package/dist/services/api/client.js +265 -15
- package/dist/services/api/undici-client.js +15 -21
- package/eslint.config.ts +70 -70
- package/package.json +8 -7
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -281
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -281
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -5053
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/dist/commands/config.d.ts +0 -21
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/dev.d.ts +0 -16
- package/dist/commands/dev.d.ts.map +0 -1
- package/dist/commands/dev.js.map +0 -1
- package/dist/commands/env.d.ts +0 -4
- package/dist/commands/env.d.ts.map +0 -1
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/gui.d.ts +0 -4
- package/dist/commands/gui.d.ts.map +0 -1
- package/dist/commands/gui.js +0 -69
- package/dist/commands/gui.js.map +0 -1
- package/dist/commands/init.d.ts +0 -15
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/login.d.ts +0 -20
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/payments.d.ts +0 -41
- package/dist/commands/payments.d.ts.map +0 -1
- package/dist/commands/payments.js.map +0 -1
- package/dist/commands/team/index.d.ts +0 -4
- package/dist/commands/team/index.d.ts.map +0 -1
- package/dist/commands/team/index.js.map +0 -1
- package/dist/commands/trigger.d.ts +0 -4
- package/dist/commands/trigger.d.ts.map +0 -1
- package/dist/commands/trigger.js.map +0 -1
- package/dist/commands/webhooks.d.ts +0 -23
- package/dist/commands/webhooks.d.ts.map +0 -1
- package/dist/commands/webhooks.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/services/analytics/service.d.ts +0 -35
- package/dist/services/analytics/service.d.ts.map +0 -1
- package/dist/services/analytics/service.js.map +0 -1
- package/dist/services/api/client.d.ts +0 -26
- package/dist/services/api/client.d.ts.map +0 -1
- package/dist/services/api/client.js.map +0 -1
- package/dist/services/api/rate-limiter.d.ts +0 -64
- package/dist/services/api/rate-limiter.d.ts.map +0 -1
- package/dist/services/api/rate-limiter.js.map +0 -1
- package/dist/services/api/undici-client.d.ts +0 -39
- package/dist/services/api/undici-client.d.ts.map +0 -1
- package/dist/services/api/undici-client.js.map +0 -1
- package/dist/services/config/manager.d.ts +0 -16
- package/dist/services/config/manager.d.ts.map +0 -1
- package/dist/services/config/manager.js.map +0 -1
- package/dist/services/dev/process-manager.d.ts +0 -50
- package/dist/services/dev/process-manager.d.ts.map +0 -1
- package/dist/services/dev/process-manager.js.map +0 -1
- package/dist/services/github/auth.d.ts +0 -15
- package/dist/services/github/auth.d.ts.map +0 -1
- package/dist/services/github/auth.js +0 -79
- package/dist/services/github/auth.js.map +0 -1
- package/dist/services/github/client.d.ts +0 -95
- package/dist/services/github/client.d.ts.map +0 -1
- package/dist/services/github/client.js +0 -130
- package/dist/services/github/client.js.map +0 -1
- package/dist/services/github/sync.d.ts +0 -26
- package/dist/services/github/sync.d.ts.map +0 -1
- package/dist/services/github/sync.js +0 -203
- package/dist/services/github/sync.js.map +0 -1
- package/dist/services/payments/simulator.d.ts +0 -28
- package/dist/services/payments/simulator.d.ts.map +0 -1
- package/dist/services/payments/simulator.js.map +0 -1
- package/dist/services/team/service.d.ts +0 -44
- package/dist/services/team/service.d.ts.map +0 -1
- package/dist/services/team/service.js.map +0 -1
- package/dist/services/web/server.d.ts +0 -31
- package/dist/services/web/server.d.ts.map +0 -1
- package/dist/services/web/server.js +0 -206
- package/dist/services/web/server.js.map +0 -1
- package/dist/types/paymongo.d.ts +0 -204
- package/dist/types/paymongo.d.ts.map +0 -1
- package/dist/types/paymongo.js.map +0 -1
- package/dist/types/schemas.d.ts +0 -80
- package/dist/types/schemas.d.ts.map +0 -1
- package/dist/types/schemas.js.map +0 -1
- package/dist/utils/bulk.d.ts +0 -62
- package/dist/utils/bulk.d.ts.map +0 -1
- package/dist/utils/bulk.js.map +0 -1
- package/dist/utils/cache.d.ts +0 -22
- package/dist/utils/cache.d.ts.map +0 -1
- package/dist/utils/cache.js.map +0 -1
- package/dist/utils/constants.d.ts +0 -32
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -34
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -20
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/spinner.d.ts +0 -17
- package/dist/utils/spinner.d.ts.map +0 -1
- package/dist/utils/spinner.js.map +0 -1
- package/dist/utils/validator.d.ts +0 -10
- package/dist/utils/validator.d.ts.map +0 -1
- package/dist/utils/validator.js.map +0 -1
- package/dist/utils/webhook-store.d.ts +0 -22
- package/dist/utils/webhook-store.d.ts.map +0 -1
- package/dist/utils/webhook-store.js.map +0 -1
- package/jest.config.ts +0 -30
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
# PayMongo CLI - AI Agent Instructions
|
|
2
|
-
|
|
3
|
-
## Project Overview
|
|
4
|
-
PayMongo CLI is a TypeScript-based developer tool for PayMongo payment integration with local webhook forwarding via ngrok tunneling. It uses **ESM modules** (`"type": "module"`) with Commander.js for CLI commands.
|
|
5
|
-
|
|
6
|
-
## Architecture
|
|
7
|
-
|
|
8
|
-
### Code Structure
|
|
9
|
-
```
|
|
10
|
-
src/
|
|
11
|
-
├── commands/ # CLI commands (commander.js) - one file per top-level command
|
|
12
|
-
├── services/ # Core business logic
|
|
13
|
-
│ ├── api/ # ApiClient - PayMongo V1 API wrapper with retries & caching
|
|
14
|
-
│ ├── config/ # ConfigManager - .paymongo file handling via cosmiconfig
|
|
15
|
-
│ └── web/ # Express + Socket.io for GUI dashboard
|
|
16
|
-
├── types/ # TypeScript definitions + Zod schemas
|
|
17
|
-
└── utils/ # Shared utilities (errors, logging, cache, validation)
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Key Patterns
|
|
21
|
-
|
|
22
|
-
**Error Handling** - Always use custom error classes from `src/utils/errors.ts`:
|
|
23
|
-
```typescript
|
|
24
|
-
import { PayMongoError, NetworkError, ConfigError, ApiKeyError } from '../utils/errors.js';
|
|
25
|
-
throw new PayMongoError('User-friendly message', 'ERROR_CODE', 400);
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Retry Logic** - Use `withRetry()` for network operations:
|
|
29
|
-
```typescript
|
|
30
|
-
import { withRetry } from '../utils/errors.js';
|
|
31
|
-
const result = await withRetry(() => apiCall(), { maxRetries: 3, silent: true });
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Lazy Loading** - Import heavy dependencies inside functions to keep CLI startup fast (<100ms):
|
|
35
|
-
```typescript
|
|
36
|
-
// ✓ Correct - lazy load inside action
|
|
37
|
-
.action(async () => {
|
|
38
|
-
const { confirm } = await import('@inquirer/prompts');
|
|
39
|
-
});
|
|
40
|
-
// ✗ Wrong - top-level import slows startup
|
|
41
|
-
import { confirm } from '@inquirer/prompts';
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**ESM Imports** - Always use `.js` extension for local imports:
|
|
45
|
-
```typescript
|
|
46
|
-
import ConfigManager from '../services/config/manager.js';
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Configuration
|
|
50
|
-
- Project config: `.paymongo` (JSON, managed via `ConfigManager`)
|
|
51
|
-
- Global credentials: `~/.paymongo/credentials.enc` (AES-256-CBC encrypted)
|
|
52
|
-
- Validation: Zod schemas in `src/types/schemas.ts`
|
|
53
|
-
|
|
54
|
-
## Development Workflow
|
|
55
|
-
|
|
56
|
-
### Commands
|
|
57
|
-
```bash
|
|
58
|
-
npm run build # Compile TypeScript
|
|
59
|
-
npm run dev # Watch mode compilation
|
|
60
|
-
npm link # Test CLI globally as 'paymongo'
|
|
61
|
-
npm test # Jest with ESM (--experimental-vm-modules)
|
|
62
|
-
npm run lint:fix # ESLint auto-fix
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Testing Strategy
|
|
66
|
-
- **Mocking ESM**: Use `jest.unstable_mockModule()` before dynamic imports
|
|
67
|
-
- Structure: `tests/unit/`, `tests/integration
|
|
68
|
-
- Mock external services (axios, ngrok, filesystem)
|
|
69
|
-
|
|
70
|
-
Example test pattern:
|
|
71
|
-
```typescript
|
|
72
|
-
jest.unstable_mockModule('axios', () => ({ default: mockAxios }));
|
|
73
|
-
const { ApiClient } = await import('../../src/services/api/client.js');
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Code Conventions
|
|
77
|
-
|
|
78
|
-
### TypeScript
|
|
79
|
-
- Strict mode enabled with `noImplicitAny`, `noUncheckedIndexedAccess`
|
|
80
|
-
- Avoid `any` - use proper types from `src/types/paymongo.ts`
|
|
81
|
-
- Config validation via Zod: `validateConfig()` from `src/types/schemas.ts`
|
|
82
|
-
|
|
83
|
-
### Commit Messages
|
|
84
|
-
Follow conventional commits: `feat:`, `fix:`, `docs:`, `test:`, `refactor:`
|
|
85
|
-
|
|
86
|
-
### Security
|
|
87
|
-
- Never log API keys or sensitive data
|
|
88
|
-
- Use `ConfigManager` for credential access
|
|
89
|
-
- Keep `.paymongo` and `.env` in `.gitignore`
|
|
90
|
-
|
|
91
|
-
## Key Files Reference
|
|
92
|
-
- [src/services/api/client.ts](src/services/api/client.ts) - API wrapper with interceptors
|
|
93
|
-
- [src/utils/errors.ts](src/utils/errors.ts) - Error classes + `withRetry()`
|
|
94
|
-
- [src/types/schemas.ts](src/types/schemas.ts) - Zod validation schemas
|
|
95
|
-
- [src/services/config/manager.ts](src/services/config/manager.ts) - Config file handling
|
|
1
|
+
# PayMongo CLI - AI Agent Instructions
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
PayMongo CLI is a TypeScript-based developer tool for PayMongo payment integration with local webhook forwarding via ngrok tunneling. It uses **ESM modules** (`"type": "module"`) with Commander.js for CLI commands.
|
|
5
|
+
|
|
6
|
+
## Architecture
|
|
7
|
+
|
|
8
|
+
### Code Structure
|
|
9
|
+
```
|
|
10
|
+
src/
|
|
11
|
+
├── commands/ # CLI commands (commander.js) - one file per top-level command
|
|
12
|
+
├── services/ # Core business logic
|
|
13
|
+
│ ├── api/ # ApiClient - PayMongo V1 API wrapper with retries & caching
|
|
14
|
+
│ ├── config/ # ConfigManager - .paymongo file handling via cosmiconfig
|
|
15
|
+
│ └── web/ # Express + Socket.io for GUI dashboard
|
|
16
|
+
├── types/ # TypeScript definitions + Zod schemas
|
|
17
|
+
└── utils/ # Shared utilities (errors, logging, cache, validation)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Key Patterns
|
|
21
|
+
|
|
22
|
+
**Error Handling** - Always use custom error classes from `src/utils/errors.ts`:
|
|
23
|
+
```typescript
|
|
24
|
+
import { PayMongoError, NetworkError, ConfigError, ApiKeyError } from '../utils/errors.js';
|
|
25
|
+
throw new PayMongoError('User-friendly message', 'ERROR_CODE', 400);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Retry Logic** - Use `withRetry()` for network operations:
|
|
29
|
+
```typescript
|
|
30
|
+
import { withRetry } from '../utils/errors.js';
|
|
31
|
+
const result = await withRetry(() => apiCall(), { maxRetries: 3, silent: true });
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Lazy Loading** - Import heavy dependencies inside functions to keep CLI startup fast (<100ms):
|
|
35
|
+
```typescript
|
|
36
|
+
// ✓ Correct - lazy load inside action
|
|
37
|
+
.action(async () => {
|
|
38
|
+
const { confirm } = await import('@inquirer/prompts');
|
|
39
|
+
});
|
|
40
|
+
// ✗ Wrong - top-level import slows startup
|
|
41
|
+
import { confirm } from '@inquirer/prompts';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**ESM Imports** - Always use `.js` extension for local imports:
|
|
45
|
+
```typescript
|
|
46
|
+
import ConfigManager from '../services/config/manager.js';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
- Project config: `.paymongo` (JSON, managed via `ConfigManager`)
|
|
51
|
+
- Global credentials: `~/.paymongo/credentials.enc` (AES-256-CBC encrypted)
|
|
52
|
+
- Validation: Zod schemas in `src/types/schemas.ts`
|
|
53
|
+
|
|
54
|
+
## Development Workflow
|
|
55
|
+
|
|
56
|
+
### Commands
|
|
57
|
+
```bash
|
|
58
|
+
npm run build # Compile TypeScript
|
|
59
|
+
npm run dev # Watch mode compilation
|
|
60
|
+
npm link # Test CLI globally as 'paymongo'
|
|
61
|
+
npm test # Jest with ESM (--experimental-vm-modules)
|
|
62
|
+
npm run lint:fix # ESLint auto-fix
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Testing Strategy
|
|
66
|
+
- **Mocking ESM**: Use `jest.unstable_mockModule()` before dynamic imports
|
|
67
|
+
- Structure: `tests/unit/`, `tests/integration/`
|
|
68
|
+
- Mock external services (axios, ngrok, filesystem)
|
|
69
|
+
|
|
70
|
+
Example test pattern:
|
|
71
|
+
```typescript
|
|
72
|
+
jest.unstable_mockModule('axios', () => ({ default: mockAxios }));
|
|
73
|
+
const { ApiClient } = await import('../../src/services/api/client.js');
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Code Conventions
|
|
77
|
+
|
|
78
|
+
### TypeScript
|
|
79
|
+
- Strict mode enabled with `noImplicitAny`, `noUncheckedIndexedAccess`
|
|
80
|
+
- Avoid `any` - use proper types from `src/types/paymongo.ts`
|
|
81
|
+
- Config validation via Zod: `validateConfig()` from `src/types/schemas.ts`
|
|
82
|
+
|
|
83
|
+
### Commit Messages
|
|
84
|
+
Follow conventional commits: `feat:`, `fix:`, `docs:`, `test:`, `refactor:`
|
|
85
|
+
|
|
86
|
+
### Security
|
|
87
|
+
- Never log API keys or sensitive data
|
|
88
|
+
- Use `ConfigManager` for credential access
|
|
89
|
+
- Keep `.paymongo` and `.env` in `.gitignore`
|
|
90
|
+
|
|
91
|
+
## Key Files Reference
|
|
92
|
+
- [src/services/api/client.ts](src/services/api/client.ts) - API wrapper with interceptors
|
|
93
|
+
- [src/utils/errors.ts](src/utils/errors.ts) - Error classes + `withRetry()`
|
|
94
|
+
- [src/types/schemas.ts](src/types/schemas.ts) - Zod validation schemas
|
|
95
|
+
- [src/services/config/manager.ts](src/services/config/manager.ts) - Config file handling
|
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
strategy:
|
|
13
13
|
matrix:
|
|
14
14
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
15
|
-
node-version: [
|
|
15
|
+
node-version: [20, 22]
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
18
|
- name: Checkout code
|
|
@@ -39,50 +39,6 @@ jobs:
|
|
|
39
39
|
|
|
40
40
|
- name: Upload coverage reports
|
|
41
41
|
uses: codecov/codecov-action@v3
|
|
42
|
-
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '
|
|
42
|
+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20'
|
|
43
43
|
with:
|
|
44
44
|
file: ./coverage/lcov.info
|
|
45
|
-
|
|
46
|
-
release:
|
|
47
|
-
needs: test
|
|
48
|
-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
49
|
-
runs-on: ubuntu-latest
|
|
50
|
-
|
|
51
|
-
steps:
|
|
52
|
-
- name: Checkout code
|
|
53
|
-
uses: actions/checkout@v4
|
|
54
|
-
|
|
55
|
-
- name: Setup Node.js
|
|
56
|
-
uses: actions/setup-node@v4
|
|
57
|
-
with:
|
|
58
|
-
node-version: 18
|
|
59
|
-
registry-url: 'https://registry.npmjs.org'
|
|
60
|
-
|
|
61
|
-
- name: Install dependencies
|
|
62
|
-
run: npm ci
|
|
63
|
-
|
|
64
|
-
- name: Build project
|
|
65
|
-
run: npm run build
|
|
66
|
-
|
|
67
|
-
- name: Run tests
|
|
68
|
-
run: npm test -- --passWithNoTests
|
|
69
|
-
|
|
70
|
-
- name: Publish to npm
|
|
71
|
-
run: npm publish --access public
|
|
72
|
-
env:
|
|
73
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
74
|
-
|
|
75
|
-
- name: Create GitHub release
|
|
76
|
-
uses: actions/create-release@v1
|
|
77
|
-
env:
|
|
78
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
-
with:
|
|
80
|
-
tag_name: v${{ github.run_number }}
|
|
81
|
-
release_name: Release v${{ github.run_number }}
|
|
82
|
-
body: |
|
|
83
|
-
## Changes
|
|
84
|
-
- Automated release from CI/CD pipeline
|
|
85
|
-
- All tests passed
|
|
86
|
-
- Code quality checks completed
|
|
87
|
-
draft: false
|
|
88
|
-
prerelease: false
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -58,7 +58,7 @@ jobs:
|
|
|
58
58
|
body: |
|
|
59
59
|
## Changes
|
|
60
60
|
|
|
61
|
-
See [CHANGELOG.md](https://github.com/
|
|
61
|
+
See [CHANGELOG.md](https://github.com/leodyversemilla07/paymongo-cli/blob/main/CHANGELOG.md) for details.
|
|
62
62
|
|
|
63
63
|
## Installation
|
|
64
64
|
|
package/AGENTS.md
CHANGED
|
@@ -167,7 +167,6 @@ const config = validateConfig(input);
|
|
|
167
167
|
tests/
|
|
168
168
|
├── unit/ # Unit tests (single functions/classes)
|
|
169
169
|
├── integration/ # Integration tests (command end-to-end)
|
|
170
|
-
└── e2e/ # End-to-end tests (full CLI workflows)
|
|
171
170
|
```
|
|
172
171
|
|
|
173
172
|
### Mocking ESM Modules
|
package/CHANGELOG.md
CHANGED
|
@@ -7,12 +7,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.4.3] - 2026-01-26
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Enhanced Error Handling** - Improved error messages in `init`, `login`, and `env` commands with specific error types:
|
|
15
|
+
- `ApiKeyError`: Invalid or unauthorized API keys
|
|
16
|
+
- `NetworkError`: Connection and timeout issues
|
|
17
|
+
- `PayMongoError`: API-specific errors with status codes
|
|
18
|
+
- Actionable error messages with troubleshooting guidance
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- **Test Output Cleanup** - Suppressed verbose console output and Node.js warnings in test runs:
|
|
23
|
+
- Added `silent: true` to Jest configuration to hide CLI command output
|
|
24
|
+
- Added `NODE_NO_WARNINGS=1` to test scripts to suppress experimental VM warnings
|
|
25
|
+
- Cleaner test output focused on results rather than implementation details
|
|
26
|
+
|
|
27
|
+
- **API Client Consolidation** - Merged `UndiciClient` into main `ApiClient` class:
|
|
28
|
+
- Removed separate `undici-client.ts` file
|
|
29
|
+
- Updated all imports and tests to use unified `ApiClient`
|
|
30
|
+
- Maintained all existing functionality (caching, rate limiting, error handling)
|
|
31
|
+
|
|
32
|
+
### Removed
|
|
33
|
+
|
|
34
|
+
- **E2E Test Suite** - Removed `tests/e2e/` folder and associated files:
|
|
35
|
+
- Deleted `tests/e2e/login.test.ts` and `tests/e2e/README.md`
|
|
36
|
+
- Removed e2e references from documentation (`CONTRIBUTING.md`, `AGENTS.md`, `.github/copilot-instructions.md`)
|
|
37
|
+
- Unit tests provide equivalent coverage without requiring real API credentials
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- **Test Compatibility** - Updated test mocks to work with new error handling:
|
|
42
|
+
- Changed `validateApiKey()` from boolean return to void (throws on error)
|
|
43
|
+
- Updated test expectations for error throwing instead of boolean returns
|
|
44
|
+
- Maintained test coverage while improving error handling consistency
|
|
45
|
+
|
|
10
46
|
## [1.4.1] - 2026-01-26
|
|
11
47
|
|
|
12
48
|
### Added
|
|
13
49
|
|
|
14
50
|
- **Comprehensive Test Coverage** - Added 380 unit tests across 23 test suites:
|
|
15
|
-
- Complete test coverage for
|
|
51
|
+
- Complete test coverage for 8 CLI command files (init, config, login, dev, payments, env, trigger, webhooks)
|
|
16
52
|
- 100% coverage for each tested command with comprehensive error handling and edge cases
|
|
17
53
|
- Established testing patterns for Commander.js commands with ESM module mocking
|
|
18
54
|
- Mock implementations for all external dependencies (axios, ngrok, filesystem operations)
|
|
@@ -234,6 +270,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
234
270
|
|
|
235
271
|
| Version | Release Date | Highlights |
|
|
236
272
|
| ------- | ------------ | -------------------------------------------------------------------- |
|
|
273
|
+
| [1.4.3] | 2026-01-26 | Enhanced error handling, test output cleanup, API client consolidation |
|
|
237
274
|
| [1.4.1] | 2026-01-26 | Test coverage completion, ESLint compliance, documentation updates |
|
|
238
275
|
| [1.4.0] | 2026-01-26 | Code generation, HTTP client migration, GUI removal, performance optimization |
|
|
239
276
|
| [1.3.0] | 2026-01-25 | Rate limiting protection, bulk operations, team collaboration |
|
|
@@ -244,6 +281,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
244
281
|
---
|
|
245
282
|
|
|
246
283
|
## Upgrade Guide
|
|
284
|
+
### Upgrading to 1.4.3
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
npm install -g paymongo-cli@latest
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Breaking Changes:** None. This is a backward-compatible patch release.
|
|
291
|
+
|
|
292
|
+
**New Features:**
|
|
293
|
+
- Enhanced error handling with specific error types and actionable messages
|
|
294
|
+
- Cleaner test output with suppressed console logs and warnings
|
|
295
|
+
- Consolidated API client implementation
|
|
296
|
+
|
|
247
297
|
### Upgrading to 1.4.1
|
|
248
298
|
|
|
249
299
|
```bash
|
|
@@ -322,7 +372,8 @@ npm install -g paymongo-cli
|
|
|
322
372
|
- [Issue Tracker](https://github.com/leodyversemilla07/paymongo-cli/issues)
|
|
323
373
|
- [PayMongo API Documentation](https://developers.paymongo.com/)
|
|
324
374
|
|
|
325
|
-
[Unreleased]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.
|
|
375
|
+
[Unreleased]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.3...HEAD
|
|
376
|
+
[1.4.3]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.1...v1.4.3
|
|
326
377
|
[1.4.1]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.0...v1.4.1
|
|
327
378
|
[1.4.0]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.3.0...v1.4.0
|
|
328
379
|
[1.3.0]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.2.0...v1.3.0
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Leodyver Semilla
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Leodyver Semilla
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ PayMongo CLI is the official-feel command-line tool designed to streamline your
|
|
|
28
28
|
|
|
29
29
|
### Prerequisites
|
|
30
30
|
|
|
31
|
-
- **Node.js**:
|
|
31
|
+
- **Node.js**: v20.0.0 or higher
|
|
32
32
|
- **ngrok account**: Required for webhook forwarding (free tier works great!)
|
|
33
33
|
|
|
34
34
|
### Install via npm (Recommended)
|
package/TESTING.md
CHANGED
|
@@ -8,7 +8,7 @@ This document tracks the progress of improving test coverage for the PayMongo CL
|
|
|
8
8
|
|
|
9
9
|
- **Overall Coverage**: ~65-70% statements (estimated post-all command testing completion)
|
|
10
10
|
- **Target**: ≥80% statements/branches/functions/lines
|
|
11
|
-
- **Progress**: API client, init command, config command, login command, dev command, env command,
|
|
11
|
+
- **Progress**: API client, init command, config command, login command, dev command, env command, trigger command, webhooks command, CLI entry point, and payments command testing completed
|
|
12
12
|
- **Total Tests**: 380 passing tests across 23 test suites
|
|
13
13
|
|
|
14
14
|
## Completed Work
|
|
@@ -107,18 +107,6 @@ This document tracks the progress of improving test coverage for the PayMongo CL
|
|
|
107
107
|
- Resolved Commander.js testing by using `command.parseAsync()` pattern
|
|
108
108
|
- All 12 tests passing, comprehensive validation and error handling covered
|
|
109
109
|
|
|
110
|
-
- **GUI Command Testing**: ✅ **COMPLETED**
|
|
111
|
-
- Created comprehensive test file `tests/unit/gui-command.test.ts` with 11 test cases achieving 100% coverage
|
|
112
|
-
- Coverage improved to full coverage for src/commands/gui.ts
|
|
113
|
-
- Added tests for:
|
|
114
|
-
- GUI dashboard startup with default/custom port and host options
|
|
115
|
-
- WebServer integration and graceful shutdown handling
|
|
116
|
-
- SIGINT/SIGTERM signal handling for clean shutdown
|
|
117
|
-
- No configuration error handling
|
|
118
|
-
- Server startup error scenarios
|
|
119
|
-
- Resolved complex WebServer mocking and signal handler testing
|
|
120
|
-
- All 11 tests passing, comprehensive startup and shutdown scenarios covered
|
|
121
|
-
|
|
122
110
|
- **Trigger Command Testing**: ✅ **COMPLETED**
|
|
123
111
|
- Created comprehensive test file `tests/unit/trigger-command.test.ts` with 16 test cases achieving 100% coverage
|
|
124
112
|
- Coverage improved to full coverage for src/commands/trigger.ts
|
|
@@ -175,7 +163,6 @@ This document tracks the progress of improving test coverage for the PayMongo CL
|
|
|
175
163
|
| src/commands/dev.ts | ~60% | ~50% | ~70% | ~60% | ✅ **Completed** |
|
|
176
164
|
| **src/commands/payments.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
177
165
|
| **src/commands/env.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
178
|
-
| **src/commands/gui.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
179
166
|
| **src/commands/trigger.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
180
167
|
| **src/commands/webhooks.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
181
168
|
| All other command files | 0% | 0% | 0% | Not started |
|