paymongo-cli 1.4.6 → 1.4.7

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/CHANGELOG.md CHANGED
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.4.7] - 2026-02-27
11
+
12
+ ### Changed
13
+
14
+ - **Error Handling** - Replaced all 60 `process.exit(1)` calls across 10 command files with a `CommandError` throw pattern and centralized global error handler in `index.ts`.
15
+ - **CLI Version** - Version string is now dynamically read from `package.json` instead of being hardcoded, keeping User-Agent headers and `--version` output always in sync.
16
+ - **Magic Numbers** - Extracted hardcoded cache TTL, rate limit thresholds, and API base URL into named constants in `constants.ts`.
17
+ - **Async File I/O** - Converted synchronous `fs` operations to `fs/promises` in dev-mode hot paths:
18
+ - `webhook-store.ts`: Lazy async directory creation, all read/write operations non-blocking.
19
+ - `analytics/service.ts`: Async persistence with `_ready` promise to prevent constructor race conditions.
20
+ - `process-manager.ts`: All static methods async; updated 13 call sites across dev subcommands.
21
+ - **Deduplicated ValidationError** - Removed duplicate `ValidationError` class from `validator.ts`; single definition now lives in `errors.ts` and is re-exported.
22
+ - **DevServer Logging** - Replaced raw `console.log`/`console.error` calls in `DevServer` with structured `Logger` instance for consistent, controllable output.
23
+
24
+ ### Fixed
25
+
26
+ - **Input Sanitization** - Enhanced `validateWebhookUrl()` with max URL length (2048 chars), automatic whitespace trimming, and rejection of URLs containing embedded credentials.
27
+ - **Race Condition** - Fixed analytics service race where `loadEvents()` could overwrite in-memory state written by `recordEvent()` before async load completed.
28
+ - **Unhandled Promises** - `recordEvent()` calls in `DevServer` are now properly awaited via extracted `processWebhookBody()` method, preventing silent failures.
29
+ - **Bulk Import Errors** - `importWebhooks()` and `importPayments()` now catch file-not-found and malformed JSON errors, throwing descriptive `PayMongoError` instead of raw stack traces.
30
+
31
+ ### Added
32
+
33
+ - **Unit Tests** - Added 62 new tests across 3 previously-uncovered modules:
34
+ - `BulkOperations` (19 tests): export/import, file errors, JSON validation, filename generation.
35
+ - `DevProcessManager` (22 tests): state persistence, process detection, log management, uptime formatting.
36
+ - `TeamService` (21 tests): key bundles, member management, serialization, team operations.
37
+
38
+ ### Security
39
+
40
+ - Webhook URL validation now blocks URLs with embedded `user:pass@` credentials to prevent credential leakage.
41
+
10
42
  ## [1.4.6] - 2026-02-03
11
43
 
12
44
  ### Changed
@@ -315,6 +347,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
315
347
 
316
348
  | Version | Release Date | Highlights |
317
349
  | ------- | ------------ | -------------------------------------------------------------------- |
350
+ | [1.4.7] | 2026-02-27 | CommandError pattern, dynamic version, async FS, input sanitization |
351
+ | [1.4.6] | 2026-02-03 | Config validation, webhook signatures, lazy loading |
352
+ | [1.4.5] | 2026-02-01 | AES-256-GCM encryption, .gitignore handling |
353
+ | [1.4.4] | 2026-01-27 | Codebase modularization, integration testing |
318
354
  | [1.4.3] | 2026-01-26 | Enhanced error handling, test output cleanup, API client consolidation |
319
355
  | [1.4.1] | 2026-01-26 | Test coverage completion, ESLint compliance, documentation updates |
320
356
  | [1.4.0] | 2026-01-26 | Code generation, HTTP client migration, GUI removal, performance optimization |
@@ -326,6 +362,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
326
362
  ---
327
363
 
328
364
  ## Upgrade Guide
365
+ ### Upgrading to 1.4.7
366
+
367
+ ```bash
368
+ npm install -g paymongo-cli@latest
369
+ ```
370
+
371
+ **Breaking Changes:** None. This is a backward-compatible patch release.
372
+
373
+ **Improvements:**
374
+ - All `process.exit(1)` calls replaced with structured error handling — CLI now exits cleanly through global error handlers
375
+ - Sync file I/O in dev-mode hot paths converted to async for better event loop performance
376
+ - Webhook URL validation hardened against credential leakage and oversized inputs
377
+ - CLI version always matches `package.json` — no more stale User-Agent strings
378
+ - Duplicate `ValidationError` class consolidated to single definition
379
+ - DevServer uses structured Logger instead of raw console output
380
+ - Bulk import operations now produce user-friendly error messages
381
+ - 62 new unit tests covering BulkOperations, DevProcessManager, and TeamService
382
+
329
383
  ### Upgrading to 1.4.3
330
384
 
331
385
  ```bash
@@ -417,7 +471,10 @@ npm install -g paymongo-cli
417
471
  - [Issue Tracker](https://github.com/leodyversemilla07/paymongo-cli/issues)
418
472
  - [PayMongo API Documentation](https://developers.paymongo.com/)
419
473
 
420
- [Unreleased]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.4...HEAD
474
+ [Unreleased]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.7...HEAD
475
+ [1.4.7]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.6...v1.4.7
476
+ [1.4.6]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.5...v1.4.6
477
+ [1.4.5]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.4...v1.4.5
421
478
  [1.4.4]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.3...v1.4.4
422
479
  [1.4.3]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.1...v1.4.3
423
480
  [1.4.1]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.4.0...v1.4.1