openpost 1.0.4
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/README.md +359 -0
- package/dist/auth/authHandler.d.ts +11 -0
- package/dist/auth/authHandler.d.ts.map +1 -0
- package/dist/builtInVault.d.ts +25 -0
- package/dist/builtInVault.d.ts.map +1 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/crud.d.ts +3 -0
- package/dist/cli/commands/crud.d.ts.map +1 -0
- package/dist/cli/commands/envVar.d.ts +3 -0
- package/dist/cli/commands/envVar.d.ts.map +1 -0
- package/dist/cli/commands/importExport.d.ts +3 -0
- package/dist/cli/commands/importExport.d.ts.map +1 -0
- package/dist/cli/commands/license.d.ts +3 -0
- package/dist/cli/commands/license.d.ts.map +1 -0
- package/dist/cli/commands/list.d.ts +4 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/proxyCookie.d.ts +3 -0
- package/dist/cli/commands/proxyCookie.d.ts.map +1 -0
- package/dist/cli/commands/run.d.ts +3 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/servers.d.ts +3 -0
- package/dist/cli/commands/servers.d.ts.map +1 -0
- package/dist/cli/commands/vault.d.ts +3 -0
- package/dist/cli/commands/vault.d.ts.map +1 -0
- package/dist/cli/config.d.ts +23 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/mcp-collection-stdio.d.ts +13 -0
- package/dist/cli/mcp-collection-stdio.d.ts.map +1 -0
- package/dist/cli/mcp-stdio.d.ts +13 -0
- package/dist/cli/mcp-stdio.d.ts.map +1 -0
- package/dist/cli/openpost.d.ts +64 -0
- package/dist/cli/openpost.d.ts.map +1 -0
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli-bundle.js +263 -0
- package/dist/container/serviceContainer.d.ts +35 -0
- package/dist/container/serviceContainer.d.ts.map +1 -0
- package/dist/cookieJar.d.ts +18 -0
- package/dist/cookieJar.d.ts.map +1 -0
- package/dist/curlParser.d.ts +11 -0
- package/dist/curlParser.d.ts.map +1 -0
- package/dist/errors/appError.d.ts +35 -0
- package/dist/errors/appError.d.ts.map +1 -0
- package/dist/events/typedEventBus.d.ts +9 -0
- package/dist/events/typedEventBus.d.ts.map +1 -0
- package/dist/httpClient.d.ts +15 -0
- package/dist/httpClient.d.ts.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.min.js +212 -0
- package/dist/inheritance.d.ts +9 -0
- package/dist/inheritance.d.ts.map +1 -0
- package/dist/interfaces/configProvider.d.ts +10 -0
- package/dist/interfaces/configProvider.d.ts.map +1 -0
- package/dist/interfaces/eventBus.d.ts +44 -0
- package/dist/interfaces/eventBus.d.ts.map +1 -0
- package/dist/interfaces/fileStore.d.ts +66 -0
- package/dist/interfaces/fileStore.d.ts.map +1 -0
- package/dist/interfaces/logger.d.ts +9 -0
- package/dist/interfaces/logger.d.ts.map +1 -0
- package/dist/interfaces/secretStorage.d.ts +7 -0
- package/dist/interfaces/secretStorage.d.ts.map +1 -0
- package/dist/interpolation.d.ts +10 -0
- package/dist/interpolation.d.ts.map +1 -0
- package/dist/licenseValidator.d.ts +18 -0
- package/dist/licenseValidator.d.ts.map +1 -0
- package/dist/managementMcpServer.d.ts +80 -0
- package/dist/managementMcpServer.d.ts.map +1 -0
- package/dist/mcpServer.d.ts +54 -0
- package/dist/mcpServer.d.ts.map +1 -0
- package/dist/mcpToolDefs.d.ts +13 -0
- package/dist/mcpToolDefs.d.ts.map +1 -0
- package/dist/mcpToolEngine.d.ts +22 -0
- package/dist/mcpToolEngine.d.ts.map +1 -0
- package/dist/mockServer.d.ts +117 -0
- package/dist/mockServer.d.ts.map +1 -0
- package/dist/mockServerManager.d.ts +219 -0
- package/dist/mockServerManager.d.ts.map +1 -0
- package/dist/openApiGenerator.d.ts +19 -0
- package/dist/openApiGenerator.d.ts.map +1 -0
- package/dist/openApiParser.d.ts +11 -0
- package/dist/openApiParser.d.ts.map +1 -0
- package/dist/openpost.d.ts +101 -0
- package/dist/openpost.d.ts.map +1 -0
- package/dist/routeMatcher.d.ts +59 -0
- package/dist/routeMatcher.d.ts.map +1 -0
- package/dist/scripting/sandbox.d.ts +14 -0
- package/dist/scripting/sandbox.d.ts.map +1 -0
- package/dist/serverRegistry.d.ts +22 -0
- package/dist/serverRegistry.d.ts.map +1 -0
- package/dist/services/collectionRunEngine.d.ts +24 -0
- package/dist/services/collectionRunEngine.d.ts.map +1 -0
- package/dist/services/collectionService.d.ts +22 -0
- package/dist/services/collectionService.d.ts.map +1 -0
- package/dist/services/environmentService.d.ts +16 -0
- package/dist/services/environmentService.d.ts.map +1 -0
- package/dist/services/historyService.d.ts +16 -0
- package/dist/services/historyService.d.ts.map +1 -0
- package/dist/services/requestEngine.d.ts +49 -0
- package/dist/services/requestEngine.d.ts.map +1 -0
- package/dist/services/settingsService.d.ts +21 -0
- package/dist/services/settingsService.d.ts.map +1 -0
- package/dist/services/snapshotEngine.d.ts +23 -0
- package/dist/services/snapshotEngine.d.ts.map +1 -0
- package/dist/storage/standaloneFileStore.d.ts +109 -0
- package/dist/storage/standaloneFileStore.d.ts.map +1 -0
- package/dist/stripComments.d.ts +3 -0
- package/dist/stripComments.d.ts.map +1 -0
- package/dist/testRunner.d.ts +4 -0
- package/dist/testRunner.d.ts.map +1 -0
- package/dist/types.d.ts +1011 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/vaultManager.d.ts +50 -0
- package/dist/vaultManager.d.ts.map +1 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# ⚡ Open Post
|
|
2
|
+
|
|
3
|
+
> Headless REST & GraphQL API client — run collections, manage environments, mock servers, MCP servers, vault, and license from the command line or programmatically. No UI required.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/openpost)
|
|
6
|
+
[](https://github.com/openAPI-Studio/open-post/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# Global install (CLI)
|
|
12
|
+
npm install -g openpost
|
|
13
|
+
|
|
14
|
+
# Project dependency (library)
|
|
15
|
+
npm install openpost
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## CLI Quick Start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# List your collections
|
|
22
|
+
openpost list collections
|
|
23
|
+
|
|
24
|
+
# Run all requests in a collection
|
|
25
|
+
openpost run "My API" --env production
|
|
26
|
+
|
|
27
|
+
# Run a single request
|
|
28
|
+
openpost run-request "My API" "Get Users" --env staging
|
|
29
|
+
|
|
30
|
+
# Import a cURL command
|
|
31
|
+
openpost import curl "curl -X GET https://api.example.com/users -H 'Authorization: Bearer token'"
|
|
32
|
+
|
|
33
|
+
# Check license status
|
|
34
|
+
openpost license status
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## CLI Commands
|
|
38
|
+
|
|
39
|
+
### Execution
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
openpost run <collection> [options] # Run all requests in a collection
|
|
43
|
+
openpost run-request <collection> <request> # Run a single request
|
|
44
|
+
openpost scan <collection> <request> # Security scan a request
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Run options:**
|
|
48
|
+
|
|
49
|
+
| Flag | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| `--env <name>` | Environment to use |
|
|
52
|
+
| `--mode <sequential\|parallel>` | Run mode (default: sequential) |
|
|
53
|
+
| `--concurrency <n>` | Parallel concurrency (default: 5) |
|
|
54
|
+
| `--filter <pattern>` | Filter requests by name (glob: `GET*`, `*users*`) |
|
|
55
|
+
| `--retry <n>` | Retry failed requests n times |
|
|
56
|
+
| `--dry-run` | Validate without sending requests |
|
|
57
|
+
| `--timeout <ms>` | Override request timeout |
|
|
58
|
+
| `--ssl-off` | Disable SSL certificate verification |
|
|
59
|
+
| `--proxy <name>` | Use a named proxy profile |
|
|
60
|
+
| `--output-file <path>` | Save results to a JSON file |
|
|
61
|
+
| `--verbose` | Show detailed request/response info |
|
|
62
|
+
| `--quiet` | Suppress all output except errors |
|
|
63
|
+
| `--json` | Machine-readable JSON output |
|
|
64
|
+
|
|
65
|
+
**Example output:**
|
|
66
|
+
```
|
|
67
|
+
⚡ Running My API (12 requests, sequential)
|
|
68
|
+
Environment: production
|
|
69
|
+
|
|
70
|
+
✓ GET /users 200 45ms
|
|
71
|
+
✓ status equals 200
|
|
72
|
+
✓ body is JSON
|
|
73
|
+
✓ POST /users 201 120ms
|
|
74
|
+
✗ GET /users/999 404 32ms
|
|
75
|
+
✗ status equals 200 (got: 404)
|
|
76
|
+
✓ PUT /users/1 200 89ms
|
|
77
|
+
|
|
78
|
+
────────────────────────────────────────
|
|
79
|
+
11 passed 1 failed 1.2s total
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Collections & Requests
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# List
|
|
86
|
+
openpost list collections
|
|
87
|
+
openpost list requests <collection>
|
|
88
|
+
|
|
89
|
+
# Create
|
|
90
|
+
openpost create collection "My API"
|
|
91
|
+
openpost create request "My API" "Get Users" --method GET --url "{{base_url}}/users"
|
|
92
|
+
openpost create request "My API" "Create User" --method POST --url "{{base_url}}/users" \
|
|
93
|
+
--header "Content-Type:application/json" --body '{"name":"test"}' \
|
|
94
|
+
--auth-bearer "my-token"
|
|
95
|
+
openpost create folder "My API" "Auth"
|
|
96
|
+
|
|
97
|
+
# Delete
|
|
98
|
+
openpost delete collection "My API"
|
|
99
|
+
openpost delete request "My API" "Get Users"
|
|
100
|
+
openpost delete folder "My API" "Auth"
|
|
101
|
+
|
|
102
|
+
# Rename & Duplicate
|
|
103
|
+
openpost rename collection "Old Name" "New Name"
|
|
104
|
+
openpost duplicate collection "My API"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Auth flags for `create request`:**
|
|
108
|
+
|
|
109
|
+
| Flag | Example |
|
|
110
|
+
|------|---------|
|
|
111
|
+
| `--auth-bearer <token>` | `--auth-bearer "sk-abc123"` |
|
|
112
|
+
| `--auth-basic <user:pass>` | `--auth-basic "admin:secret"` |
|
|
113
|
+
| `--auth-apikey <key:value:location>` | `--auth-apikey "X-API-Key:abc123:header"` |
|
|
114
|
+
|
|
115
|
+
### Environments & Variables
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Manage environments
|
|
119
|
+
openpost create environment "staging"
|
|
120
|
+
openpost env set production # Set active environment
|
|
121
|
+
openpost env add production base_url https://api.example.com
|
|
122
|
+
openpost list environments
|
|
123
|
+
|
|
124
|
+
# Collection variables
|
|
125
|
+
openpost var set "My API" base_url https://api.example.com
|
|
126
|
+
openpost var list "My API"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use `{{variable}}` syntax in URLs, headers, body, and auth fields. Variables resolve automatically when running requests.
|
|
130
|
+
|
|
131
|
+
### Import & Export
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Import
|
|
135
|
+
openpost import curl "curl -X GET https://api.example.com/users" --collection "My API"
|
|
136
|
+
openpost import curl ./request.sh --name "Get Users" --collection "My API"
|
|
137
|
+
openpost import openapi ./swagger.yaml
|
|
138
|
+
cat spec.yaml | openpost import openapi -
|
|
139
|
+
|
|
140
|
+
# Export
|
|
141
|
+
openpost export curl "My API" "Get Users" --env production
|
|
142
|
+
openpost export openapi "My API"
|
|
143
|
+
openpost export collection "My API"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### License
|
|
147
|
+
|
|
148
|
+
Open Post includes a built-in trial license. Advanced features (mock servers, MCP servers, vault) require an active license.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
openpost license status # Check current license
|
|
152
|
+
openpost license activate <key> # Activate a license key
|
|
153
|
+
openpost license deactivate # Remove license
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Vault (Encrypted Secret Storage)
|
|
157
|
+
|
|
158
|
+
Store secrets locally with AES-256-GCM encryption. Secrets resolve as `{{variable}}` placeholders in requests.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
openpost vault create --password <pw> # Create encrypted vault
|
|
162
|
+
openpost vault add-secret api_key sk-live-abc --password <pw> # Add secret
|
|
163
|
+
openpost vault list-secrets --password <pw> # List secrets (masked)
|
|
164
|
+
openpost vault delete-secret api_key --password <pw> # Delete secret
|
|
165
|
+
openpost vault change-password --current <old> --new <new>
|
|
166
|
+
openpost vault lock
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Mock Servers
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
openpost mock start # Start all mock servers with autoStart
|
|
173
|
+
openpost mock stop # Stop all
|
|
174
|
+
openpost mock list # Show status table
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### MCP Servers (AI Integration)
|
|
178
|
+
|
|
179
|
+
Start a headless Management MCP server that any AI client can connect to:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
openpost serve --port 3199
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
⚡ Management MCP Server
|
|
187
|
+
|
|
188
|
+
Listening on http://127.0.0.1:3199/mcp
|
|
189
|
+
|
|
190
|
+
Connect your AI client:
|
|
191
|
+
Claude Desktop: "open-post": { "url": "http://127.0.0.1:3199/mcp" }
|
|
192
|
+
Cursor/Kiro: Settings → MCP → Add Server → URL
|
|
193
|
+
|
|
194
|
+
32 tools available. Press Ctrl+C to stop.
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Proxy
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
openpost proxy add "Corporate" --host proxy.corp.com --port 8080 --protocol https
|
|
201
|
+
openpost proxy list
|
|
202
|
+
openpost proxy set-default "Corporate"
|
|
203
|
+
openpost proxy delete "Corporate"
|
|
204
|
+
|
|
205
|
+
# Use for a specific run
|
|
206
|
+
openpost run "My API" --proxy "Corporate"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Cookies
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
openpost cookies list # Show stored cookies
|
|
213
|
+
openpost cookies clear # Clear cookie jar
|
|
214
|
+
openpost cookies toggle # Enable/disable cookies
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### History
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
openpost list history # Show recent requests
|
|
221
|
+
openpost history clear # Clear all history
|
|
222
|
+
openpost history delete <id>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Configuration
|
|
226
|
+
|
|
227
|
+
Permanently change default behavior:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
openpost config set output json # Always output JSON
|
|
231
|
+
openpost config set verbose true # Always verbose
|
|
232
|
+
openpost config set quiet true # Errors only (CI mode)
|
|
233
|
+
openpost config set sslVerification false # Disable SSL permanently
|
|
234
|
+
openpost config set defaultProxy "Corporate" # Default proxy for all requests
|
|
235
|
+
openpost config set defaultScope global # Default to global scope
|
|
236
|
+
openpost config list # Show all settings
|
|
237
|
+
openpost config reset # Reset to defaults
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Config stored at `~/.openpost/global/cli-config.json`. CLI flags always override config.
|
|
241
|
+
|
|
242
|
+
## Programmatic Usage
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
import { OpenPost } from 'openpost';
|
|
246
|
+
|
|
247
|
+
const op = new OpenPost({ workspace: '/path/to/project' });
|
|
248
|
+
|
|
249
|
+
// Run a single request
|
|
250
|
+
const { response, testResults } = await op.runRequest('My API', 'Get Users', {
|
|
251
|
+
env: 'production'
|
|
252
|
+
});
|
|
253
|
+
console.log(response.status); // 200
|
|
254
|
+
console.log(response.body); // '{"users": [...]}'
|
|
255
|
+
|
|
256
|
+
// Run entire collection
|
|
257
|
+
const entry = await op.runCollection('My API', {
|
|
258
|
+
env: 'production',
|
|
259
|
+
mode: 'sequential',
|
|
260
|
+
onProgress: (r) => console.log(`${r.passed ? '✓' : '✗'} ${r.method} ${r.url}`),
|
|
261
|
+
});
|
|
262
|
+
console.log(`${entry.passed} passed, ${entry.failed} failed`);
|
|
263
|
+
|
|
264
|
+
// Collections & Environments
|
|
265
|
+
op.createCollection('New API');
|
|
266
|
+
op.listCollections();
|
|
267
|
+
op.setActiveEnvironment('production');
|
|
268
|
+
|
|
269
|
+
// Import
|
|
270
|
+
op.importCurl('curl -X GET https://api.example.com/users', 'My API');
|
|
271
|
+
|
|
272
|
+
// License
|
|
273
|
+
op.activateLicense('eyJhbG...');
|
|
274
|
+
op.isLicensed(); // true
|
|
275
|
+
|
|
276
|
+
// Start headless MCP server
|
|
277
|
+
await op.startManagementMcp({ port: 3199 });
|
|
278
|
+
|
|
279
|
+
// Cleanup
|
|
280
|
+
await op.dispose();
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## CI/CD Usage
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Run API tests in CI pipeline
|
|
287
|
+
npm install -g openpost
|
|
288
|
+
openpost run "My API" --env staging --quiet
|
|
289
|
+
# Exit code: 0 = all pass, 1 = any fail, 2 = error
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**GitHub Actions example:**
|
|
293
|
+
```yaml
|
|
294
|
+
- name: API Tests
|
|
295
|
+
run: |
|
|
296
|
+
npm install -g openpost
|
|
297
|
+
openpost run "My API" --env staging --quiet
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Save results for reporting:**
|
|
301
|
+
```bash
|
|
302
|
+
openpost run "My API" --env staging --json --output-file results.json
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Global Options
|
|
306
|
+
|
|
307
|
+
| Flag | Description | Default |
|
|
308
|
+
|------|-------------|---------|
|
|
309
|
+
| `--workspace <path>` | Project directory | Current directory |
|
|
310
|
+
| `--scope <local\|global>` | Storage scope | `local` |
|
|
311
|
+
| `--env <name>` | Active environment | None |
|
|
312
|
+
| `--json` | JSON output | `false` |
|
|
313
|
+
| `--verbose` | Detailed output | `false` |
|
|
314
|
+
| `--quiet` | Errors only | `false` |
|
|
315
|
+
| `--no-color` | Disable colors | Colors on |
|
|
316
|
+
| `--dry-run` | Validate only | `false` |
|
|
317
|
+
| `--ssl-off` | Disable SSL | SSL on |
|
|
318
|
+
| `--proxy <name>` | Use proxy | None |
|
|
319
|
+
| `--filter <pattern>` | Filter requests | All |
|
|
320
|
+
| `--retry <n>` | Retry failures | No retry |
|
|
321
|
+
| `--output-file <path>` | Save results | None |
|
|
322
|
+
| `--yes` | Skip confirmations | Prompt |
|
|
323
|
+
|
|
324
|
+
## Exit Codes
|
|
325
|
+
|
|
326
|
+
| Code | Meaning |
|
|
327
|
+
|------|---------|
|
|
328
|
+
| `0` | Success — all requests and tests passed |
|
|
329
|
+
| `1` | Failure — one or more requests or tests failed |
|
|
330
|
+
| `2` | Error — bad arguments, resource not found, license required |
|
|
331
|
+
|
|
332
|
+
## Data Storage
|
|
333
|
+
|
|
334
|
+
Open Post stores data as plain JSON files:
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
.openpost/ ← per workspace (local scope)
|
|
338
|
+
├── collections.json
|
|
339
|
+
├── environments.json
|
|
340
|
+
├── history.json
|
|
341
|
+
└── config.json
|
|
342
|
+
|
|
343
|
+
~/.openpost/global/ ← shared across workspaces (global scope)
|
|
344
|
+
├── collections.json
|
|
345
|
+
├── environments.json
|
|
346
|
+
├── vault.enc ← encrypted vault
|
|
347
|
+
└── cli-config.json ← CLI settings
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Data is fully compatible with the [Open Post VS Code extension](https://marketplace.visualstudio.com/items?itemName=open-post.open-post). Collections, environments, and history sync between CLI and VS Code automatically.
|
|
351
|
+
|
|
352
|
+
## Related
|
|
353
|
+
|
|
354
|
+
- [Open Post VS Code Extension](https://marketplace.visualstudio.com/items?itemName=open-post.open-post) — Full GUI API client inside VS Code
|
|
355
|
+
- [GitHub Repository](https://github.com/openAPI-Studio/open-post)
|
|
356
|
+
|
|
357
|
+
## License
|
|
358
|
+
|
|
359
|
+
See [LICENSE](https://github.com/openAPI-Studio/open-post/blob/main/LICENSE)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiRequest } from '../types';
|
|
2
|
+
export declare function applyAuth(request: ApiRequest, variables: Record<string, string>): {
|
|
3
|
+
headers: Record<string, string>;
|
|
4
|
+
queryParams: Record<string, string>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Build an Authorization: Digest header from a 401 challenge.
|
|
8
|
+
* Supports MD5, SHA-256, and their -sess variants per RFC 7616.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildDigestAuthHeader(challengeHeader: string, username: string, password: string, method: string, uri: string, nonceCount?: number): string;
|
|
11
|
+
//# sourceMappingURL=authHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authHandler.d.ts","sourceRoot":"","sources":["../../src/auth/authHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,UAAU,CAAC;AAIlD,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IACjF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,CAyEA;AAuBD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,UAAU,GAAE,MAAU,GACrB,MAAM,CAyCR"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CertificateEntry } from './types';
|
|
2
|
+
export declare class BuiltInVault {
|
|
3
|
+
static readonly VAULT_PATH: string;
|
|
4
|
+
private decryptedData;
|
|
5
|
+
private derivedKey;
|
|
6
|
+
private currentSalt;
|
|
7
|
+
exists(): boolean;
|
|
8
|
+
isUnlocked(): boolean;
|
|
9
|
+
create(password: string): Promise<void>;
|
|
10
|
+
unlock(password: string): Promise<void>;
|
|
11
|
+
lock(): void;
|
|
12
|
+
changePassword(currentPassword: string, newPassword: string): Promise<void>;
|
|
13
|
+
getSecret(key: string): string | undefined;
|
|
14
|
+
getAllSecrets(): Record<string, string>;
|
|
15
|
+
setSecret(key: string, value: string): Promise<void>;
|
|
16
|
+
deleteSecret(key: string): Promise<void>;
|
|
17
|
+
getCertificates(): CertificateEntry[];
|
|
18
|
+
saveCertificate(cert: CertificateEntry): Promise<void>;
|
|
19
|
+
deleteCertificate(id: string): Promise<void>;
|
|
20
|
+
private requireUnlocked;
|
|
21
|
+
private decrypt;
|
|
22
|
+
private writeVaultFile;
|
|
23
|
+
private persist;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=builtInVault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtInVault.d.ts","sourceRoot":"","sources":["../src/builtInVault.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAqB3C,qBAAa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,UAAU,SAA+D;IAEzF,OAAO,CAAC,aAAa,CAA0B;IAC/C,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,WAAW,CAAuB;IAE1C,MAAM,IAAI,OAAO;IAIjB,UAAU,IAAI,OAAO;IAIf,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWvC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB7C,IAAI,IAAI,IAAI;IAMN,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BjF,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAK1C,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAKjC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpD,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ9C,eAAe,IAAI,gBAAgB,EAAE;IAK/B,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYtD,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlD,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,cAAc;YAqBR,OAAO;CAGtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QA8BtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crud.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/crud.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAyIpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envVar.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/envVar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QA0DtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importExport.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/importExport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,QAmF5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QA+CvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAkFpD;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAuBvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxyCookie.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/proxyCookie.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QAuF3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QAiGnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/servers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QA2EtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/vault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QAwGrD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface CliConfig {
|
|
2
|
+
output: 'human' | 'json';
|
|
3
|
+
verbose: boolean;
|
|
4
|
+
quiet: boolean;
|
|
5
|
+
defaultScope: 'local' | 'global';
|
|
6
|
+
defaultWorkspace: string | null;
|
|
7
|
+
color: boolean;
|
|
8
|
+
sslVerification: boolean;
|
|
9
|
+
defaultProxy: string | null;
|
|
10
|
+
}
|
|
11
|
+
declare const DEFAULTS: CliConfig;
|
|
12
|
+
export declare function loadCliConfig(): CliConfig;
|
|
13
|
+
export declare function saveCliConfig(partial: Partial<CliConfig>): void;
|
|
14
|
+
export declare function getConfigValue(key: string): unknown;
|
|
15
|
+
export declare function setConfigValue(key: string, value: string): {
|
|
16
|
+
ok: boolean;
|
|
17
|
+
error?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function resetConfig(): void;
|
|
20
|
+
export declare function getConfigPath(): string;
|
|
21
|
+
export declare function getValidKeys(): string[];
|
|
22
|
+
export { DEFAULTS as CLI_DEFAULTS };
|
|
23
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,GAAG,QAAQ,CAAC;IACjC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,QAAA,MAAM,QAAQ,EAAE,SAAoK,CAAC;AAMrL,wBAAgB,aAAa,IAAI,SAAS,CAKzC;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAK/D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGnD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAc1F;AAED,wBAAgB,WAAW,IAAI,IAAI,CAA6B;AAChE,wBAAgB,aAAa,IAAI,MAAM,CAAwB;AAC/D,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAAoC;AAC5E,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stdio MCP Server for Open Post Collections.
|
|
3
|
+
*
|
|
4
|
+
* Exposes a collection's requests as MCP tools via stdin/stdout JSON-RPC.
|
|
5
|
+
* Runs standalone — no VS Code required.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node mcp-collection.js --collection <id> --scope global
|
|
9
|
+
* node mcp-collection.js --collection <id> --scope local --workspace /path
|
|
10
|
+
* node mcp-collection.js --collection <id> --scope global --env <envId> --env-scope global
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=mcp-collection-stdio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-collection-stdio.d.ts","sourceRoot":"","sources":["../../src/cli/mcp-collection-stdio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stdio MCP Server for Open Post — universal single-entry MCP.
|
|
3
|
+
*
|
|
4
|
+
* No --workspace CLI arg needed. Workspace is passed per tool call via args.workspace.
|
|
5
|
+
* Global-scope tools need no workspace. Server-management tools return clear errors.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node dist/mcp-stdio.js # start stdio server
|
|
9
|
+
* node dist/mcp-stdio.js --health-check # basic health check
|
|
10
|
+
* node dist/mcp-stdio.js --health-check --workspace /path # check specific workspace
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=mcp-stdio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-stdio.d.ts","sourceRoot":"","sources":["../../src/cli/mcp-stdio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { OpenPost } from '../openpost';
|
|
2
|
+
export interface GlobalOpts {
|
|
3
|
+
workspace?: string;
|
|
4
|
+
scope?: string;
|
|
5
|
+
env?: string;
|
|
6
|
+
json?: boolean;
|
|
7
|
+
verbose?: boolean;
|
|
8
|
+
quiet?: boolean;
|
|
9
|
+
color?: boolean;
|
|
10
|
+
dryRun?: boolean;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
sslOff?: boolean;
|
|
13
|
+
proxy?: string;
|
|
14
|
+
filter?: string;
|
|
15
|
+
retry?: number;
|
|
16
|
+
outputFile?: string;
|
|
17
|
+
yes?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveContext(opts: GlobalOpts): {
|
|
20
|
+
op: OpenPost;
|
|
21
|
+
out: {
|
|
22
|
+
success(msg: string): void;
|
|
23
|
+
error(msg: string): void;
|
|
24
|
+
warn(msg: string): void;
|
|
25
|
+
info(msg: string): void;
|
|
26
|
+
verbose(msg: string): void;
|
|
27
|
+
heading(msg: string): void;
|
|
28
|
+
line(msg: string): void;
|
|
29
|
+
blank(): void;
|
|
30
|
+
divider(): void;
|
|
31
|
+
table(headers: string[], rows: string[][]): void;
|
|
32
|
+
json(data: unknown): void;
|
|
33
|
+
result(data: unknown): void;
|
|
34
|
+
spinner(msg: string): any;
|
|
35
|
+
method(m: string): string;
|
|
36
|
+
status(s: number): string;
|
|
37
|
+
pass(label: string): void;
|
|
38
|
+
fail(label: string, actual?: string): void;
|
|
39
|
+
requestLine(passed: boolean, method: string, url: string, status: number, time: number): void;
|
|
40
|
+
summary(passed: number, failed: number, time: number): void;
|
|
41
|
+
};
|
|
42
|
+
scope: "local" | "global";
|
|
43
|
+
sslVerification: boolean;
|
|
44
|
+
proxy: string | undefined;
|
|
45
|
+
opts: {
|
|
46
|
+
json: boolean;
|
|
47
|
+
verbose: boolean;
|
|
48
|
+
quiet: boolean;
|
|
49
|
+
workspace: string;
|
|
50
|
+
scope: "local" | "global";
|
|
51
|
+
sslVerification: boolean;
|
|
52
|
+
proxy: string | undefined;
|
|
53
|
+
env?: string;
|
|
54
|
+
color?: boolean;
|
|
55
|
+
dryRun?: boolean;
|
|
56
|
+
timeout?: number;
|
|
57
|
+
sslOff?: boolean;
|
|
58
|
+
filter?: string;
|
|
59
|
+
retry?: number;
|
|
60
|
+
outputFile?: string;
|
|
61
|
+
yes?: boolean;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=openpost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openpost.d.ts","sourceRoot":"","sources":["../../src/cli/openpost.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAsCvC,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cANH,MAAM;gBACJ,OAAO;iBAAW,OAAO;kBAC3D,MAAM;iBAAW,OAAO;iBAA2B,MAAM;gBAC3D,MAAM;qBAAe,MAAM;cAAQ,OAAO;;EA8BnD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface OutputOpts {
|
|
2
|
+
json: boolean;
|
|
3
|
+
verbose: boolean;
|
|
4
|
+
quiet: boolean;
|
|
5
|
+
color: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function createOutput(opts: OutputOpts): {
|
|
8
|
+
success(msg: string): void;
|
|
9
|
+
error(msg: string): void;
|
|
10
|
+
warn(msg: string): void;
|
|
11
|
+
info(msg: string): void;
|
|
12
|
+
verbose(msg: string): void;
|
|
13
|
+
heading(msg: string): void;
|
|
14
|
+
line(msg: string): void;
|
|
15
|
+
blank(): void;
|
|
16
|
+
divider(): void;
|
|
17
|
+
table(headers: string[], rows: string[][]): void;
|
|
18
|
+
json(data: unknown): void;
|
|
19
|
+
result(data: unknown): void;
|
|
20
|
+
spinner(msg: string): any;
|
|
21
|
+
method(m: string): string;
|
|
22
|
+
status(s: number): string;
|
|
23
|
+
pass(label: string): void;
|
|
24
|
+
fail(label: string, actual?: string): void;
|
|
25
|
+
requestLine(passed: boolean, method: string, url: string, status: number, time: number): void;
|
|
26
|
+
summary(passed: number, failed: number, time: number): void;
|
|
27
|
+
};
|
|
28
|
+
export type Output = ReturnType<typeof createOutput>;
|
|
29
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU;iBAO5B,MAAM;eAIR,MAAM;cAIP,MAAM;cAIN,MAAM;iBAIH,MAAM;iBAIN,MAAM;cAIT,MAAM;;;mBAOD,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE;eAO9B,OAAO;iBAEL,OAAO;iBAIP,MAAM;cAMT,MAAM,GAAG,MAAM;cAQf,MAAM,GAAG,MAAM;gBAMb,MAAM;gBACN,MAAM,WAAW,MAAM;wBAIf,OAAO,UAAU,MAAM,OAAO,MAAM,UAAU,MAAM,QAAQ,MAAM;oBAMtE,MAAM,UAAU,MAAM,QAAQ,MAAM;EAUvD;AAED,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
|