paymongo-cli 1.4.12 → 1.4.14
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/.gitattributes +2 -0
- package/.github/copilot-instructions.md +8 -6
- package/AGENTS.md +8 -9
- package/CHANGELOG.md +21 -0
- package/README.md +3 -3
- package/biome.json +72 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/commands/config/actions.js +13 -5
- package/dist/commands/config/analytics.js +75 -0
- package/dist/commands/config/helpers.js +14 -25
- package/dist/commands/config/rate-limit.js +3 -3
- package/dist/commands/config.js +7 -1
- package/dist/commands/dev/logs.js +13 -4
- package/dist/commands/dev/status.js +1 -1
- package/dist/commands/dev/stop.js +2 -2
- package/dist/commands/dev.js +10 -258
- package/dist/commands/doctor.js +7 -8
- package/dist/commands/env.js +10 -19
- package/dist/commands/generate/templates/index.js +3 -3
- package/dist/commands/generate.js +7 -7
- package/dist/commands/init.js +22 -36
- package/dist/commands/login.js +18 -29
- package/dist/commands/payments/actions.js +15 -15
- package/dist/commands/payments/helpers.js +6 -24
- package/dist/commands/payments.js +1 -1
- package/dist/commands/shared/auth.js +23 -0
- package/dist/commands/shared/runtime.js +35 -0
- package/dist/commands/team/index.js +4 -4
- package/dist/commands/trigger/actions.js +2 -2
- package/dist/commands/trigger/helpers.js +13 -9
- package/dist/commands/trigger.js +2 -2
- package/dist/commands/webhooks/actions.js +11 -11
- package/dist/commands/webhooks/helpers.js +5 -23
- package/dist/commands/webhooks.js +1 -1
- package/dist/index.js +37 -19
- package/dist/services/analytics/service.js +3 -3
- package/dist/services/api/client.js +8 -4
- package/dist/services/api/rate-limiter.js +3 -2
- package/dist/services/config/manager.js +13 -3
- package/dist/services/dev/process-manager.js +4 -4
- package/dist/services/dev/server.js +7 -8
- package/dist/services/dev/session.js +354 -0
- package/dist/services/team/service.js +1 -1
- package/dist/types/schemas.js +3 -2
- package/dist/utils/bulk.js +11 -11
- package/dist/utils/cache.js +5 -5
- package/dist/utils/constants.js +1 -1
- package/dist/utils/webhook-store.js +3 -3
- package/package.json +11 -25
- package/vitest.config.ts +18 -0
- package/eslint.config.ts +0 -70
package/.gitattributes
ADDED
|
@@ -48,7 +48,7 @@ import ConfigManager from '../services/config/manager.js';
|
|
|
48
48
|
|
|
49
49
|
## Configuration
|
|
50
50
|
- Project config: `.paymongo` (JSON, managed via `ConfigManager`)
|
|
51
|
-
- Global credentials: `~/.paymongo/credentials.enc` (AES-256-CBC
|
|
51
|
+
- Global credentials: `~/.paymongo/credentials.enc` (AES-256-GCM encrypted, with legacy AES-256-CBC migration support)
|
|
52
52
|
- Validation: Zod schemas in `src/types/schemas.ts`
|
|
53
53
|
|
|
54
54
|
## Development Workflow
|
|
@@ -58,18 +58,20 @@ import ConfigManager from '../services/config/manager.js';
|
|
|
58
58
|
npm run build # Compile TypeScript
|
|
59
59
|
npm run dev # Watch mode compilation
|
|
60
60
|
npm link # Test CLI globally as 'paymongo'
|
|
61
|
-
npm test #
|
|
62
|
-
npm run lint:fix #
|
|
61
|
+
npm test # Vitest
|
|
62
|
+
npm run lint:fix # Biome auto-fix
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
### Testing Strategy
|
|
66
|
-
- **
|
|
66
|
+
- **Framework**: Vitest
|
|
67
67
|
- Structure: `tests/unit/`, `tests/integration/`
|
|
68
|
-
- Mock external services (
|
|
68
|
+
- Mock external services (undici, ngrok, filesystem)
|
|
69
69
|
|
|
70
70
|
Example test pattern:
|
|
71
71
|
```typescript
|
|
72
|
-
|
|
72
|
+
import { vi } from 'vitest';
|
|
73
|
+
|
|
74
|
+
vi.mock('undici', () => ({ request: mockRequest }));
|
|
73
75
|
const { ApiClient } = await import('../../src/services/api/client.js');
|
|
74
76
|
```
|
|
75
77
|
|
package/AGENTS.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
PayMongo CLI is a developer-first command-line tool for PayMongo payment integration with local webhook forwarding. It uses **ESM modules** with Commander.js for CLI commands and provides a terminal-first interface.
|
|
6
6
|
|
|
7
|
-
**Tech Stack**: TypeScript, Node.js 20+, Commander.js, built-in `http`, `undici`, ngrok, Zod,
|
|
7
|
+
**Tech Stack**: TypeScript, Node.js 20+, Commander.js, built-in `http`, `undici`, ngrok, Zod, Vitest
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -22,11 +22,11 @@ npm link # Test CLI globally during development
|
|
|
22
22
|
### Quality Assurance
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm run lint #
|
|
26
|
-
npm run lint:fix # Auto-fix
|
|
27
|
-
npm run format #
|
|
25
|
+
npm run lint # Biome check
|
|
26
|
+
npm run lint:fix # Auto-fix lint issues with Biome
|
|
27
|
+
npm run format # Biome formatting
|
|
28
28
|
npm run test # Run all tests
|
|
29
|
-
npm run test:watch #
|
|
29
|
+
npm run test:watch # Vitest watch mode
|
|
30
30
|
npm run benchmark # Performance benchmarking
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -54,7 +54,7 @@ npm run test -- tests/unit/
|
|
|
54
54
|
- **Strict mode**: Enabled with all strict checks
|
|
55
55
|
- **Module resolution**: NodeNext (ESM)
|
|
56
56
|
- **Imports**: Use `.js` extension for local imports (required for ESM)
|
|
57
|
-
- **Declarations**:
|
|
57
|
+
- **Declarations**: Currently disabled in `tsconfig.json` for build output
|
|
58
58
|
|
|
59
59
|
### Import/Export Patterns
|
|
60
60
|
|
|
@@ -329,9 +329,8 @@ Use the provided `.github/PULL_REQUEST_TEMPLATE.md` which includes:
|
|
|
329
329
|
### VS Code Extensions
|
|
330
330
|
|
|
331
331
|
- TypeScript and JavaScript Language Features
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
- Jest Runner
|
|
332
|
+
- Biome
|
|
333
|
+
- Vitest
|
|
335
334
|
|
|
336
335
|
### EditorConfig
|
|
337
336
|
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.4.13] - 2026-04-06
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Analytics Config Commands** - Added `paymongo config analytics enable`, `disable`, and `status` to manage local webhook analytics directly from the CLI.
|
|
15
|
+
- **Shared Command Runtime** - Introduced shared command runtime helpers for config loading, API client creation, auth validation, and consistent command failure handling.
|
|
16
|
+
- **Dev Session Service** - Added a dedicated dev session service to own dev-mode startup, shutdown, webhook registration, and tunnel orchestration outside the command layer.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **Test Runner** - Replaced Jest with Vitest and migrated the CLI test suite to the new runner.
|
|
21
|
+
- **Linting and Formatting** - Replaced ESLint and Prettier with Biome for linting, formatting, and import organization.
|
|
22
|
+
- **Dev Command Architecture** - Refactored `paymongo dev` so the command is a thinner CLI adapter around centralized session orchestration.
|
|
23
|
+
- **Global Runtime Wiring** - Wired the global `--no-rate-limit` flag through the shared runtime so API client behavior matches the CLI option.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- **Documentation Drift** - Aligned the README and command surface around analytics configuration and current tooling.
|
|
28
|
+
- **Detached Dev Startup** - Updated detached dev mode to reuse the active CLI entrypoint instead of depending on a hardcoded compiled path.
|
|
29
|
+
- **CLI Test Stability** - Tightened test lifecycle handling and ESM module isolation to keep the Vitest suite reliable.
|
|
30
|
+
|
|
10
31
|
## [1.4.12] - 2026-03-08
|
|
11
32
|
|
|
12
33
|
### Added
|
package/README.md
CHANGED
|
@@ -121,9 +121,9 @@ paymongo config rate-limit disable
|
|
|
121
121
|
|
|
122
122
|
Use `--no-rate-limit` with any command to temporarily disable rate limiting:
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
```bash
|
|
125
125
|
paymongo payments list --no-rate-limit
|
|
126
|
-
|
|
126
|
+
```
|
|
127
127
|
|
|
128
128
|
## Analytics (Optional)
|
|
129
129
|
|
|
@@ -147,7 +147,7 @@ paymongo config analytics status
|
|
|
147
147
|
|
|
148
148
|
# Disable analytics (default)
|
|
149
149
|
paymongo config analytics disable
|
|
150
|
-
|
|
150
|
+
```
|
|
151
151
|
|
|
152
152
|
### Analytics Features
|
|
153
153
|
|
package/biome.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"includes": ["**", "!!**/dist", "!!coverage", "!!node_modules"]
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"formatWithErrors": false,
|
|
14
|
+
"indentStyle": "space",
|
|
15
|
+
"indentWidth": 2,
|
|
16
|
+
"lineEnding": "lf",
|
|
17
|
+
"lineWidth": 100,
|
|
18
|
+
"attributePosition": "auto",
|
|
19
|
+
"bracketSameLine": false,
|
|
20
|
+
"bracketSpacing": true,
|
|
21
|
+
"expand": "auto",
|
|
22
|
+
"useEditorconfig": true
|
|
23
|
+
},
|
|
24
|
+
"linter": {
|
|
25
|
+
"enabled": true,
|
|
26
|
+
"rules": {
|
|
27
|
+
"recommended": true,
|
|
28
|
+
"complexity": {
|
|
29
|
+
"noStaticOnlyClass": "off"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"overrides": [
|
|
34
|
+
{
|
|
35
|
+
"includes": ["tests/**/*.ts"],
|
|
36
|
+
"linter": {
|
|
37
|
+
"rules": {
|
|
38
|
+
"suspicious": {
|
|
39
|
+
"noExplicitAny": "off"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"javascript": {
|
|
46
|
+
"formatter": {
|
|
47
|
+
"jsxQuoteStyle": "double",
|
|
48
|
+
"quoteProperties": "asNeeded",
|
|
49
|
+
"trailingCommas": "es5",
|
|
50
|
+
"semicolons": "always",
|
|
51
|
+
"arrowParentheses": "always",
|
|
52
|
+
"bracketSameLine": false,
|
|
53
|
+
"quoteStyle": "single",
|
|
54
|
+
"attributePosition": "auto",
|
|
55
|
+
"bracketSpacing": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"html": {
|
|
59
|
+
"formatter": {
|
|
60
|
+
"indentScriptAndStyle": false,
|
|
61
|
+
"selfCloseVoidElements": "always"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"assist": {
|
|
65
|
+
"enabled": true,
|
|
66
|
+
"actions": {
|
|
67
|
+
"source": {
|
|
68
|
+
"organizeImports": "on"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|