paymongo-cli 1.0.0 → 1.1.0

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/bin/paymongo.js +1 -1
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/commands/config.d.ts.map +1 -1
  5. package/dist/commands/config.js +99 -127
  6. package/dist/commands/config.js.map +1 -1
  7. package/dist/commands/dev.d.ts.map +1 -1
  8. package/dist/commands/dev.js +68 -102
  9. package/dist/commands/dev.js.map +1 -1
  10. package/dist/commands/gui.js +26 -31
  11. package/dist/commands/gui.js.map +1 -1
  12. package/dist/commands/init.d.ts.map +1 -1
  13. package/dist/commands/init.js +109 -159
  14. package/dist/commands/init.js.map +1 -1
  15. package/dist/commands/login.d.ts.map +1 -1
  16. package/dist/commands/login.js +78 -118
  17. package/dist/commands/login.js.map +1 -1
  18. package/dist/commands/payments.d.ts.map +1 -1
  19. package/dist/commands/payments.js +63 -65
  20. package/dist/commands/payments.js.map +1 -1
  21. package/dist/commands/team/index.js +31 -36
  22. package/dist/commands/team/index.js.map +1 -1
  23. package/dist/commands/trigger.d.ts.map +1 -1
  24. package/dist/commands/trigger.js +46 -88
  25. package/dist/commands/trigger.js.map +1 -1
  26. package/dist/commands/webhooks.d.ts.map +1 -1
  27. package/dist/commands/webhooks.js +138 -150
  28. package/dist/commands/webhooks.js.map +1 -1
  29. package/dist/index.js +37 -44
  30. package/dist/index.js.map +1 -1
  31. package/dist/services/analytics/service.d.ts +7 -1
  32. package/dist/services/analytics/service.d.ts.map +1 -1
  33. package/dist/services/analytics/service.js +15 -20
  34. package/dist/services/analytics/service.js.map +1 -1
  35. package/dist/services/api/client.d.ts +9 -8
  36. package/dist/services/api/client.d.ts.map +1 -1
  37. package/dist/services/api/client.js +33 -29
  38. package/dist/services/api/client.js.map +1 -1
  39. package/dist/services/config/manager.d.ts +1 -1
  40. package/dist/services/config/manager.d.ts.map +1 -1
  41. package/dist/services/config/manager.js +30 -72
  42. package/dist/services/config/manager.js.map +1 -1
  43. package/dist/services/github/auth.d.ts +2 -2
  44. package/dist/services/github/auth.d.ts.map +1 -1
  45. package/dist/services/github/auth.js +15 -55
  46. package/dist/services/github/auth.js.map +1 -1
  47. package/dist/services/github/client.d.ts +1 -1
  48. package/dist/services/github/client.d.ts.map +1 -1
  49. package/dist/services/github/client.js +12 -17
  50. package/dist/services/github/client.js.map +1 -1
  51. package/dist/services/github/sync.d.ts +2 -2
  52. package/dist/services/github/sync.d.ts.map +1 -1
  53. package/dist/services/github/sync.js +13 -10
  54. package/dist/services/github/sync.js.map +1 -1
  55. package/dist/services/web/server.d.ts +5 -4
  56. package/dist/services/web/server.d.ts.map +1 -1
  57. package/dist/services/web/server.js +70 -27
  58. package/dist/services/web/server.js.map +1 -1
  59. package/dist/types/paymongo.d.ts +48 -0
  60. package/dist/types/paymongo.d.ts.map +1 -1
  61. package/dist/types/paymongo.js +1 -2
  62. package/dist/types/schemas.d.ts +80 -0
  63. package/dist/types/schemas.d.ts.map +1 -0
  64. package/dist/types/schemas.js +63 -0
  65. package/dist/types/schemas.js.map +1 -0
  66. package/dist/utils/cache.d.ts +2 -0
  67. package/dist/utils/cache.d.ts.map +1 -1
  68. package/dist/utils/cache.js +65 -77
  69. package/dist/utils/cache.js.map +1 -1
  70. package/dist/utils/constants.js +16 -19
  71. package/dist/utils/constants.js.map +1 -1
  72. package/dist/utils/errors.d.ts +1 -0
  73. package/dist/utils/errors.d.ts.map +1 -1
  74. package/dist/utils/errors.js +18 -19
  75. package/dist/utils/errors.js.map +1 -1
  76. package/dist/utils/logger.d.ts +5 -4
  77. package/dist/utils/logger.d.ts.map +1 -1
  78. package/dist/utils/logger.js +12 -16
  79. package/dist/utils/logger.js.map +1 -1
  80. package/dist/utils/spinner.js +4 -8
  81. package/dist/utils/spinner.js.map +1 -1
  82. package/dist/utils/validator.d.ts +1 -1
  83. package/dist/utils/validator.d.ts.map +1 -1
  84. package/dist/utils/validator.js +6 -13
  85. package/dist/utils/validator.js.map +1 -1
  86. package/eslint.config.ts +43 -0
  87. package/jest.config.ts +30 -0
  88. package/package.json +76 -70
package/CHANGELOG.md ADDED
@@ -0,0 +1,141 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.1.0] - 2026-01-24
11
+
12
+ ### Added
13
+
14
+ - **Zod Schema Validation** - Runtime configuration validation with comprehensive error messages
15
+ - **Rate Limiting** - Express rate limiting for GUI API endpoints (100 req/min general, 20 req/min config writes)
16
+ - **New Unit Tests** - Added 11 new test files with comprehensive coverage for all services
17
+
18
+ ### Changed
19
+
20
+ - **Async Cache Operations** - Converted all sync file operations to async for better performance
21
+ - **Updated Dependencies** - Major version updates for all packages:
22
+ - commander: 11.1.0 → 14.0.2
23
+ - cosmiconfig: 8.3.6 → 9.0.0
24
+ - ora: 8.2.0 → 9.1.0
25
+ - jest: 29.7.0 → 30.2.0
26
+ - @types/node: 20.10.0 → 25.0.10
27
+ - globals: 15.0.0 → 17.1.0
28
+
29
+ ### Fixed
30
+
31
+ - **Type Safety** - Eliminated all `any` types throughout codebase (was 13+, now 0)
32
+ - **Error Handling** - Standardized error handling with custom error classes (ApiKeyError, PayMongoError, NetworkError)
33
+ - **CORS Security** - Restricted CORS to localhost origins only
34
+ - **Duplicate Handler** - Removed duplicate `unhandledRejection` handler in index.ts
35
+ - **Deprecated Imports** - Removed deprecated ZodIssue import, using native Zod 4.x types
36
+
37
+ ### Security
38
+
39
+ - Added rate limiting to prevent API abuse
40
+ - Restricted CORS to localhost origins for GUI server
41
+ - Improved webhook signature verification
42
+
43
+ ## [1.0.0] - 2026-01-24
44
+
45
+ ### Added
46
+
47
+ - **CLI Commands**
48
+ - `paymongo init` - Initialize PayMongo configuration in your project with interactive setup
49
+ - `paymongo login` - Authenticate with PayMongo using API keys with secure credential storage
50
+ - `paymongo dev` - Start local development server with webhook forwarding via ngrok tunnel
51
+ - `paymongo gui` - Launch web-based dashboard for visual payment management
52
+ - `paymongo config` - Manage CLI configuration (get, set, list, reset, export, import)
53
+ - `paymongo payments` - Create and manage payments (create, list, retrieve, refund)
54
+ - `paymongo webhooks` - Manage webhooks (create, list, delete, update, test)
55
+ - `paymongo trigger` - Trigger test webhook events for local development
56
+ - `paymongo team` - Team collaboration features (invite, list, remove members)
57
+
58
+ - **Core Features**
59
+ - Secure API key management with local encrypted storage
60
+ - Local webhook forwarding using ngrok integration
61
+ - Real-time webhook event monitoring and logging
62
+ - Support for both test and live environments
63
+ - Configuration file support (`.paymongo.json`, `paymongo.config.js`)
64
+
65
+ - **Developer Experience**
66
+ - Interactive prompts with inquirer for guided setup
67
+ - Colorful terminal output with chalk
68
+ - Loading spinners for async operations
69
+ - Comprehensive error messages with troubleshooting hints
70
+ - Input validation for API keys, amounts, and currencies
71
+
72
+ - **Web Dashboard (GUI)**
73
+ - Visual interface for payment operations
74
+ - Real-time webhook event viewer
75
+ - Configuration management panel
76
+ - Analytics and metrics display
77
+
78
+ - **GitHub Integration**
79
+ - GitHub authentication support
80
+ - Configuration sync across team members
81
+ - Secure credential sharing for teams
82
+
83
+ - **Documentation**
84
+ - Comprehensive README with quick start guide
85
+ - Detailed USER_GUIDE.md with examples
86
+ - API_REFERENCE.md for programmatic usage
87
+ - INSTALLATION.md with platform-specific instructions
88
+ - TROUBLESHOOTING.md for common issues
89
+ - CONTRIBUTING.md for contributors
90
+
91
+ ### Security
92
+
93
+ - Secure storage of API credentials in user home directory
94
+ - Support for environment variables for CI/CD pipelines
95
+ - No sensitive data logged to console or files
96
+
97
+ ---
98
+
99
+ ## Version History
100
+
101
+ | Version | Release Date | Highlights |
102
+ |---------|--------------|------------|
103
+ | [1.1.0] | 2026-01-24 | Type safety, Zod validation, rate limiting, dependency updates |
104
+ | [1.0.0] | 2026-01-24 | Initial public release |
105
+
106
+ ---
107
+
108
+ ## Upgrade Guide
109
+
110
+ ### Upgrading to 1.1.0
111
+
112
+ ```bash
113
+ npm install -g paymongo-cli@latest
114
+ ```
115
+
116
+ **Breaking Changes:** None. This is a backward-compatible release.
117
+
118
+ **New Features:**
119
+ - Runtime config validation with helpful error messages
120
+ - Rate limiting on GUI API endpoints
121
+
122
+ ### Upgrading to 1.0.0
123
+
124
+ This is the initial release. To install:
125
+
126
+ ```bash
127
+ npm install -g paymongo-cli
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Links
133
+
134
+ - [npm Package](https://www.npmjs.com/package/paymongo-cli)
135
+ - [GitHub Repository](https://github.com/leodyversemilla07/paymongo-cli)
136
+ - [Issue Tracker](https://github.com/leodyversemilla07/paymongo-cli/issues)
137
+ - [PayMongo API Documentation](https://developers.paymongo.com/)
138
+
139
+ [Unreleased]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.1.0...HEAD
140
+ [1.1.0]: https://github.com/leodyversemilla07/paymongo-cli/compare/v1.0.0...v1.1.0
141
+ [1.0.0]: https://github.com/leodyversemilla07/paymongo-cli/releases/tag/v1.0.0
package/bin/paymongo.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('../dist/index.js');
3
+ import '../dist/index.js';