@saptools/cf-debugger 0.1.12 → 0.1.13
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 +1 -65
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Signal the remote process, enable SSH if needed, forward `9229` to a free local
|
|
|
12
12
|
[](https://packagephobia.com/result?p=@saptools/cf-debugger)
|
|
13
13
|
[](https://www.typescriptlang.org)
|
|
14
14
|
|
|
15
|
-
[Install](#-install) • [Quick Start](#-quick-start) • [CLI](#-cli) • [
|
|
15
|
+
[Install](#-install) • [Quick Start](#-quick-start) • [CLI](#-cli) • [How it works](#-how-it-works) • [FAQ](#-faq)
|
|
16
16
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
@@ -136,70 +136,6 @@ cf-debugger status --region eu10 --org my-org --space dev --app my-app
|
|
|
136
136
|
|
|
137
137
|
---
|
|
138
138
|
|
|
139
|
-
## 🧑💻 Programmatic Usage
|
|
140
|
-
|
|
141
|
-
```ts
|
|
142
|
-
import {
|
|
143
|
-
startDebugger,
|
|
144
|
-
stopDebugger,
|
|
145
|
-
listSessions,
|
|
146
|
-
getSession,
|
|
147
|
-
resolveApiEndpoint,
|
|
148
|
-
} from "@saptools/cf-debugger";
|
|
149
|
-
|
|
150
|
-
const handle = await startDebugger({
|
|
151
|
-
region: "eu10",
|
|
152
|
-
org: "my-org",
|
|
153
|
-
space: "dev",
|
|
154
|
-
app: "my-app",
|
|
155
|
-
email: process.env["SAP_EMAIL"],
|
|
156
|
-
password: process.env["SAP_PASSWORD"],
|
|
157
|
-
verbose: true,
|
|
158
|
-
onStatus: (status, message) => {
|
|
159
|
-
console.log(`[${status}]`, message ?? "");
|
|
160
|
-
},
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
console.log(`Attach your debugger to localhost:${handle.session.localPort}`);
|
|
164
|
-
|
|
165
|
-
// Later — shut the tunnel down and clean up state:
|
|
166
|
-
await handle.dispose();
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
<details>
|
|
170
|
-
<summary><b>📚 Full export list</b></summary>
|
|
171
|
-
|
|
172
|
-
| Export | Description |
|
|
173
|
-
| --- | --- |
|
|
174
|
-
| `startDebugger(options)` | Open a tunnel; returns a `DebuggerHandle` |
|
|
175
|
-
| `stopDebugger({ sessionId?, key? })` | Stop one session by id or by key |
|
|
176
|
-
| `stopAllDebuggers()` | Stop every session owned by this process/machine |
|
|
177
|
-
| `listSessions()` | Return every live session as `ActiveSession[]` |
|
|
178
|
-
| `getSession(key)` | Return one session matching `{ region, org, space, app }` |
|
|
179
|
-
| `resolveApiEndpoint(key, override?)` | Map a region key to its API endpoint |
|
|
180
|
-
| `sessionKeyString(key)` | Stable string form of a session key |
|
|
181
|
-
| `CfDebuggerError` | Rich error class with typed `code` |
|
|
182
|
-
|
|
183
|
-
</details>
|
|
184
|
-
|
|
185
|
-
<details>
|
|
186
|
-
<summary><b>🧪 Error codes</b></summary>
|
|
187
|
-
|
|
188
|
-
| Code | When |
|
|
189
|
-
| --- | --- |
|
|
190
|
-
| `MISSING_CREDENTIALS` | No `SAP_EMAIL` / `SAP_PASSWORD` in env or options |
|
|
191
|
-
| `SESSION_ALREADY_RUNNING` | A session already exists for the same `region/org/space/app` |
|
|
192
|
-
| `CF_LOGIN_FAILED` | `cf api` / `cf auth` rejected the credentials |
|
|
193
|
-
| `CF_TARGET_FAILED` | Org or space not reachable |
|
|
194
|
-
| `SSH_NOT_ENABLED` | SSH disabled at space or app level and could not be enabled |
|
|
195
|
-
| `USR1_SIGNAL_FAILED` | Remote `kill -s USR1` failed, timed out, or was terminated by a signal |
|
|
196
|
-
| `TUNNEL_NOT_READY` | Inspector didn't respond on port 9229 before timeout |
|
|
197
|
-
| `PORT_UNAVAILABLE` | Preferred local port is taken and could not be freed |
|
|
198
|
-
|
|
199
|
-
</details>
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
139
|
## 🔭 How it works
|
|
204
140
|
|
|
205
141
|
```
|
package/package.json
CHANGED