simplemdg-dev-cli 2.0.4 → 2.4.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 +63 -354
- package/USER_GUIDE.md +55 -378
- package/dist/commands/cds.command.js +69 -60
- package/dist/commands/cds.command.js.map +1 -1
- package/dist/commands/cf-db.command.d.ts +2 -0
- package/dist/commands/cf-db.command.js +606 -0
- package/dist/commands/cf-db.command.js.map +1 -0
- package/dist/commands/cf.command.js +291 -280
- package/dist/commands/cf.command.js.map +1 -1
- package/dist/commands/gitlab.command.d.ts +2 -0
- package/dist/commands/gitlab.command.js +351 -0
- package/dist/commands/gitlab.command.js.map +1 -0
- package/dist/commands/npmrc.command.js +50 -44
- package/dist/commands/npmrc.command.js.map +1 -1
- package/dist/core/cache.d.ts +1 -1
- package/dist/core/cache.js +58 -31
- package/dist/core/cache.js.map +1 -1
- package/dist/core/cds.js +32 -22
- package/dist/core/cds.js.map +1 -1
- package/dist/core/cf-env-parser.d.ts +1 -1
- package/dist/core/cf-env-parser.js +4 -1
- package/dist/core/cf-env-parser.js.map +1 -1
- package/dist/core/cf.d.ts +1 -1
- package/dist/core/cf.js +46 -31
- package/dist/core/cf.js.map +1 -1
- package/dist/core/db/db-btp.d.ts +48 -0
- package/dist/core/db/db-btp.js +162 -0
- package/dist/core/db/db-btp.js.map +1 -0
- package/dist/core/db/db-cache.d.ts +35 -0
- package/dist/core/db/db-cache.js +164 -0
- package/dist/core/db/db-cache.js.map +1 -0
- package/dist/core/db/db-connection.d.ts +22 -0
- package/dist/core/db/db-connection.js +73 -0
- package/dist/core/db/db-connection.js.map +1 -0
- package/dist/core/db/db-crypto.d.ts +3 -0
- package/dist/core/db/db-crypto.js +54 -0
- package/dist/core/db/db-crypto.js.map +1 -0
- package/dist/core/db/db-hana-adapter.d.ts +32 -0
- package/dist/core/db/db-hana-adapter.js +243 -0
- package/dist/core/db/db-hana-adapter.js.map +1 -0
- package/dist/core/db/db-metadata.d.ts +25 -0
- package/dist/core/db/db-metadata.js +150 -0
- package/dist/core/db/db-metadata.js.map +1 -0
- package/dist/core/db/db-postgres-adapter.d.ts +30 -0
- package/dist/core/db/db-postgres-adapter.js +245 -0
- package/dist/core/db/db-postgres-adapter.js.map +1 -0
- package/dist/core/db/db-query-files.d.ts +20 -0
- package/dist/core/db/db-query-files.js +106 -0
- package/dist/core/db/db-query-files.js.map +1 -0
- package/dist/core/db/db-query-history.d.ts +5 -0
- package/dist/core/db/db-query-history.js +49 -0
- package/dist/core/db/db-query-history.js.map +1 -0
- package/dist/core/db/db-row.d.ts +22 -0
- package/dist/core/db/db-row.js +70 -0
- package/dist/core/db/db-row.js.map +1 -0
- package/dist/core/db/db-studio-html.d.ts +4 -0
- package/dist/core/db/db-studio-html.js +437 -0
- package/dist/core/db/db-studio-html.js.map +1 -0
- package/dist/core/db/db-studio-server.d.ts +11 -0
- package/dist/core/db/db-studio-server.js +465 -0
- package/dist/core/db/db-studio-server.js.map +1 -0
- package/dist/core/db/db-types.d.ts +174 -0
- package/dist/core/db/db-types.js +3 -0
- package/dist/core/db/db-types.js.map +1 -0
- package/dist/core/db/db-vcap-parser.d.ts +7 -0
- package/dist/core/db/db-vcap-parser.js +137 -0
- package/dist/core/db/db-vcap-parser.js.map +1 -0
- package/dist/core/doctor.d.ts +1 -1
- package/dist/core/doctor.js +14 -8
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/guide.js +31 -26
- package/dist/core/guide.js.map +1 -1
- package/dist/core/install.d.ts +1 -1
- package/dist/core/install.js +17 -11
- package/dist/core/install.js.map +1 -1
- package/dist/core/navigator.d.ts +17 -0
- package/dist/core/navigator.js +140 -0
- package/dist/core/navigator.js.map +1 -0
- package/dist/core/npmrc.js +29 -16
- package/dist/core/npmrc.js.map +1 -1
- package/dist/core/process.js +11 -6
- package/dist/core/process.js.map +1 -1
- package/dist/core/prompts.js +16 -8
- package/dist/core/prompts.js.map +1 -1
- package/dist/core/repository.d.ts +1 -1
- package/dist/core/repository.js +16 -9
- package/dist/core/repository.js.map +1 -1
- package/dist/core/scanner.d.ts +1 -1
- package/dist/core/scanner.js +13 -7
- package/dist/core/scanner.js.map +1 -1
- package/dist/core/tooling.d.ts +28 -0
- package/dist/core/tooling.js +168 -0
- package/dist/core/tooling.js.map +1 -0
- package/dist/core/types.js +2 -1
- package/dist/core/version-conflict.d.ts +2 -2
- package/dist/core/version-conflict.js +11 -6
- package/dist/core/version-conflict.js.map +1 -1
- package/dist/index.js +65 -48
- package/dist/index.js.map +1 -1
- package/dist/types-local.js +2 -1
- package/package.json +12 -6
- package/src/commands/cds.command.ts +529 -0
- package/src/commands/cf-db.command.ts +636 -0
- package/src/commands/cf.command.ts +3345 -0
- package/src/commands/gitlab.command.ts +373 -0
- package/src/commands/npmrc.command.ts +581 -0
- package/src/core/cache.ts +332 -0
- package/src/core/cds.ts +278 -0
- package/src/core/cf-env-parser.ts +131 -0
- package/src/core/cf.ts +271 -0
- package/src/core/db/db-btp.ts +207 -0
- package/src/core/db/db-cache.ts +215 -0
- package/src/core/db/db-connection.ts +79 -0
- package/src/core/db/db-crypto.ts +53 -0
- package/src/core/db/db-hana-adapter.ts +294 -0
- package/src/core/db/db-metadata.ts +174 -0
- package/src/core/db/db-postgres-adapter.ts +275 -0
- package/src/core/db/db-query-files.ts +130 -0
- package/src/core/db/db-query-history.ts +53 -0
- package/src/core/db/db-row.ts +93 -0
- package/src/core/db/db-studio-html.ts +439 -0
- package/src/core/db/db-studio-server.ts +559 -0
- package/src/core/db/db-types.ts +195 -0
- package/src/core/db/db-vcap-parser.ts +182 -0
- package/src/core/doctor.ts +70 -0
- package/src/core/guide.ts +261 -0
- package/src/core/install.ts +91 -0
- package/src/core/navigator.ts +164 -0
- package/src/core/npmrc.ts +171 -0
- package/src/core/process.ts +75 -0
- package/src/core/prompts.ts +225 -0
- package/src/core/repository.ts +36 -0
- package/src/core/scanner.ts +41 -0
- package/src/core/tooling.ts +207 -0
- package/src/core/types.ts +152 -0
- package/src/core/version-conflict.ts +46 -0
- package/src/index.ts +460 -0
- package/src/types/external.d.ts +3 -0
- package/src/types-local.ts +11 -0
- package/tsconfig.json +17 -0
package/USER_GUIDE.md
CHANGED
|
@@ -1,412 +1,89 @@
|
|
|
1
|
-
# SimpleMDG
|
|
1
|
+
# SimpleMDG CLI User Guide
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## GitLab
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Login once:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
smdg
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Install:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm i -g simplemdg-dev-cli@latest
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Open this guide:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
smdg guide
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
# Select Usage
|
|
28
|
-
|
|
29
|
-
When the CLI shows a select list:
|
|
30
|
-
|
|
31
|
-
* Type a few characters to search.
|
|
32
|
-
* Use `↑` and `↓` to move.
|
|
33
|
-
* Press `Enter` to select.
|
|
34
|
-
* If no item matches, some prompts allow using the typed value.
|
|
35
|
-
|
|
36
|
-
This is useful for long lists of BTP orgs, spaces, apps, package IDs, CAP profiles, and CDS services.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
# Common Commands
|
|
41
|
-
|
|
42
|
-
## `smdg npmrc import`
|
|
43
|
-
|
|
44
|
-
Import SimpleMDG GitLab package IDs into local cache.
|
|
45
|
-
|
|
46
|
-
Use this after downloading the package ID import file from the team.
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
smdg npmrc import
|
|
7
|
+
```powershell
|
|
8
|
+
smdg gitlab login
|
|
50
9
|
```
|
|
51
10
|
|
|
52
|
-
|
|
11
|
+
The CLI opens the GitLab token page, tries to detect the copied token from clipboard, validates it, caches it, and approves it for Git Credential Manager.
|
|
53
12
|
|
|
54
|
-
|
|
13
|
+
Clone or pull:
|
|
55
14
|
|
|
56
|
-
```
|
|
57
|
-
smdg
|
|
15
|
+
```powershell
|
|
16
|
+
smdg gitlab clone
|
|
17
|
+
smdg gitlab pull
|
|
58
18
|
```
|
|
59
19
|
|
|
60
|
-
The
|
|
20
|
+
The flow is split clearly:
|
|
61
21
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Install dependencies for the current project.
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
smdg i
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
It can scan variables such as `${SIMPLEMDG_BRANCH}` and ask for replacement values automatically.
|
|
71
|
-
|
|
72
|
-
## `smdg cf login`
|
|
73
|
-
|
|
74
|
-
Login to BTP Cloud Foundry.
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
smdg cf login
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
The CLI helps select API endpoint, org, and space. Choose to save the password on your own machine if you want automatic re-login for org switching, logs, app listing, and debugging.
|
|
81
|
-
|
|
82
|
-
It can save login information on your local machine so later commands can re-login automatically when the CF session expires.
|
|
83
|
-
|
|
84
|
-
## `smdg cf org`
|
|
85
|
-
|
|
86
|
-
Search, list, and switch Cloud Foundry orgs across regions.
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
smdg cf org
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
The CLI scans known and cached BTP region endpoints and shows orgs from different regions in one searchable list. If the CF session for a region is expired, the CLI automatically re-authenticates by using the username/password saved from `smdg cf login`.
|
|
93
|
-
|
|
94
|
-
The list includes region information, for example:
|
|
95
|
-
|
|
96
|
-
```txt
|
|
97
|
-
arthrex-dev-simplemdg eu10 · 1 space
|
|
98
|
-
alcon-dev-simplemdg br10 · 1 space
|
|
99
|
-
ait-dev-simplemdg us21 · 1 space
|
|
100
|
-
```
|
|
22
|
+
1. Pull/clone a GitLab group
|
|
23
|
+
2. Pull/clone a single repository
|
|
101
24
|
|
|
102
|
-
|
|
25
|
+
Then select root group, destination folder, sync action, and parallel jobs.
|
|
103
26
|
|
|
104
|
-
##
|
|
27
|
+
## CF DB Studio
|
|
105
28
|
|
|
106
|
-
|
|
29
|
+
A local database explorer for SAP HANA and PostgreSQL, with one-click import of credentials from BTP apps. The studio runs a web server bound to `127.0.0.1` only and opens your browser.
|
|
107
30
|
|
|
108
|
-
|
|
109
|
-
smdg cf target
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
It shows API endpoint, user, org, and space.
|
|
113
|
-
|
|
114
|
-
## `smdg cf apps`
|
|
115
|
-
|
|
116
|
-
List BTP apps in the current org and space.
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
smdg cf apps
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
The CLI uses cache first for speed and refreshes in the background.
|
|
123
|
-
|
|
124
|
-
## `smdg cf bind`
|
|
125
|
-
|
|
126
|
-
Bind the local CAP project to a deployed BTP app service.
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
smdg cf bind
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
This helps run `cds bind --to-app-services` and update `.cdsrc-private.json`.
|
|
133
|
-
|
|
134
|
-
## `smdg cf env`
|
|
135
|
-
|
|
136
|
-
Export BTP app environment variables to a clean JSON file.
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
smdg cf env
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Useful for creating `default-env.json`.
|
|
143
|
-
|
|
144
|
-
## `smdg cds watch`
|
|
145
|
-
|
|
146
|
-
Run CAP locally.
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
smdg cds watch
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
The CLI helps select CAP profile and port.
|
|
153
|
-
|
|
154
|
-
## `smdg cf logs`
|
|
155
|
-
|
|
156
|
-
View BTP app logs.
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
smdg cf logs
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
It can be used for realtime log monitoring.
|
|
163
|
-
|
|
164
|
-
## `smdg cf debug`
|
|
165
|
-
|
|
166
|
-
Debug a deployed BTP Cloud Foundry Node.js app.
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
smdg cf debug
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
The CLI guides you through:
|
|
173
|
-
|
|
174
|
-
* selecting current target or searching orgs across regions
|
|
175
|
-
* selecting BTP app
|
|
176
|
-
* selecting debug mode
|
|
177
|
-
* selecting app instance
|
|
178
|
-
* preparing Node.js inspector
|
|
179
|
-
* creating VS Code attach config
|
|
180
|
-
* opening the CF SSH tunnel
|
|
181
|
-
|
|
182
|
-
Recommended mode:
|
|
183
|
-
|
|
184
|
-
```txt
|
|
185
|
-
VS Code guided debugging
|
|
186
|
-
```
|
|
31
|
+
### Recommended flow
|
|
187
32
|
|
|
188
|
-
|
|
33
|
+
1. Run `smdg cf login` (once; you can save the password for auto re-login)
|
|
34
|
+
2. Run `smdg cf db studio`
|
|
35
|
+
3. Open the **BTP Import** tab → **Load CF apps**
|
|
36
|
+
4. Select an app → its `cf env` is read and database services are detected
|
|
37
|
+
5. Click **Save+Use** on a detected service → the connection is tested and activated
|
|
38
|
+
6. Pick the connection in the left sidebar, choose a schema
|
|
39
|
+
7. Browse tables/views in the Object Explorer, or write SQL in the **SQL Console**
|
|
40
|
+
8. Run with **Ctrl+Enter**, export to CSV/JSON, save the query, or open table **Data**
|
|
189
41
|
|
|
190
|
-
The
|
|
42
|
+
The studio never deploys anything to BTP and never shows the database password.
|
|
191
43
|
|
|
192
|
-
|
|
44
|
+
### Studio tabs
|
|
193
45
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
8. After attach succeeds, the debug toolbar appears.
|
|
46
|
+
- **SQL Console** — multiple editor tabs, run (Ctrl+Enter), format, explain (PostgreSQL), row-limit selector, export CSV/JSON, save query
|
|
47
|
+
- **Data Grid** — paginated table data with WHERE filter, click-to-sort headers, export, and inline editing
|
|
48
|
+
- **Metadata** — columns (type, nullable, default, primary key) and indexes
|
|
49
|
+
- **BTP Import** — current CF target, app list, detected services, save/activate
|
|
50
|
+
- **Query Files** — saved `.sql` queries (load, run, rename, delete)
|
|
51
|
+
- **History** — recent queries (click to reload into the editor)
|
|
52
|
+
- **Messages** — log of every action and error
|
|
202
53
|
|
|
203
|
-
|
|
54
|
+
### Read-only and dangerous SQL
|
|
204
55
|
|
|
205
|
-
|
|
56
|
+
Toggle **Read-only** in the top bar to block INSERT/UPDATE/DELETE/DROP/TRUNCATE/ALTER/CREATE/GRANT/REVOKE. Even in read/write mode, dangerous statements (DROP, TRUNCATE, ALTER, DELETE/UPDATE without WHERE) require confirmation. A "Production-like" badge appears for prod-looking orgs/apps.
|
|
206
57
|
|
|
207
|
-
|
|
58
|
+
### Terminal alternatives
|
|
208
59
|
|
|
209
|
-
```
|
|
210
|
-
smdg
|
|
60
|
+
```powershell
|
|
61
|
+
smdg cf db add # add a direct connection manually (host/port/user/password)
|
|
62
|
+
smdg cf db import # interactive import from a BTP app
|
|
63
|
+
smdg cf db connections # manage cached connections
|
|
64
|
+
smdg cf db query # run one SQL query and print/export the result
|
|
65
|
+
smdg cf db console # interactive SQL REPL
|
|
211
66
|
```
|
|
212
67
|
|
|
213
|
-
|
|
68
|
+
### Direct connections (no CF app)
|
|
214
69
|
|
|
215
|
-
|
|
70
|
+
Not every database is behind a Cloud Foundry app (for example a Neon PostgreSQL or a standalone HANA Cloud). Add those directly:
|
|
216
71
|
|
|
217
|
-
|
|
72
|
+
- In the Studio: click **+ New** in the Connections sidebar, fill in type/host/port/database/schema/user/password, click **Test**, then **Save & use**.
|
|
73
|
+
- In the terminal: `smdg cf db add`.
|
|
218
74
|
|
|
219
|
-
|
|
220
|
-
smdg npmrc create
|
|
221
|
-
smdg i
|
|
222
|
-
smdg cf login
|
|
223
|
-
smdg cf apps
|
|
224
|
-
smdg cf bind
|
|
225
|
-
smdg cf env
|
|
226
|
-
smdg cds watch
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
For logs:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
smdg cf logs
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
For BTP debugging:
|
|
236
|
-
|
|
237
|
-
```bash
|
|
238
|
-
smdg cf debug
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
For metadata XML:
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
smdg cds compline
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
# Key Features
|
|
250
|
-
|
|
251
|
-
## Private npm registry helper
|
|
252
|
-
|
|
253
|
-
Creates `.npmrc` for SimpleMDG GitLab npm packages and caches package IDs with readable names.
|
|
254
|
-
|
|
255
|
-
## Smart install helper
|
|
256
|
-
|
|
257
|
-
Scans project variables like `${SIMPLEMDG_BRANCH}` and asks for values automatically before install.
|
|
258
|
-
|
|
259
|
-
## Cloud Foundry helper
|
|
260
|
-
|
|
261
|
-
Helps with login, target checking, org switching, app list, binding, env export, logs, and debugging.
|
|
262
|
-
|
|
263
|
-
## Across-region org search
|
|
264
|
-
|
|
265
|
-
Scans known and cached BTP regions and shows orgs from many regions in one searchable list. The CLI now re-authenticates per region using the cached login profile, so switching orgs should not fail just because `cf api` changed to another region.
|
|
266
|
-
|
|
267
|
-
## CAP helper
|
|
268
|
-
|
|
269
|
-
Helps run `cds watch`, select profiles/ports, and generate CDS metadata XML.
|
|
270
|
-
|
|
271
|
-
## VS Code BTP debugging
|
|
272
|
-
|
|
273
|
-
Creates VS Code attach config and opens a CF SSH tunnel to debug BTP Node.js apps from local source code. For the first debug session of an app, use `Set NODE_OPTIONS and restart app`; later sessions can use `Inspector is already enabled`.
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
# Notes
|
|
278
|
-
|
|
279
|
-
Do not commit real secrets to Git.
|
|
280
|
-
|
|
281
|
-
Files like `.npmrc`, `default-env.json`, and cached passwords may contain sensitive data.
|
|
282
|
-
|
|
283
|
-
Use saved password only on your own machine.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
## Request Trace
|
|
287
|
-
|
|
288
|
-
```bash
|
|
289
|
-
smdg cf request-trace
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
Watch incoming HTTP requests on deployed BTP Node.js/CAP apps without editing backend source code.
|
|
293
|
-
|
|
294
|
-
The CLI guides you to select one or more apps, choose trace depth, prepare Node Inspector, inject a temporary runtime trace, and stream request logs.
|
|
295
|
-
|
|
296
|
-
It can show method, path, headers, request body, response body, status, and duration. Authorization tokens are masked by default and should only be shown fully in dev/test environments.
|
|
297
|
-
|
|
298
|
-
Alias:
|
|
299
|
-
|
|
300
|
-
```bash
|
|
301
|
-
smdg cf traffic
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
Notes:
|
|
305
|
-
|
|
306
|
-
- This works best for Node.js/CAP apps.
|
|
307
|
-
- It uses CF SSH tunnel and Node Inspector.
|
|
308
|
-
- It does not change repository source code.
|
|
309
|
-
- The trace disappears after app restart.
|
|
310
|
-
- Avoid full token/body tracing in production.
|
|
311
|
-
|
|
312
|
-
# HTTP Watch
|
|
313
|
-
|
|
314
|
-
Use this when you want to see what is calling your BTP app without adding backend logs.
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
smdg cf http-watch
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
The CLI shows a clean realtime list from existing Cloud Foundry/CDS/router logs.
|
|
321
|
-
|
|
322
|
-
It can show:
|
|
323
|
-
|
|
324
|
-
* HTTP method
|
|
325
|
-
* URL/path
|
|
326
|
-
* status code
|
|
327
|
-
* duration
|
|
328
|
-
* app instance
|
|
329
|
-
* remote user
|
|
330
|
-
* tenant
|
|
331
|
-
* request size
|
|
332
|
-
* request id / correlation id
|
|
333
|
-
|
|
334
|
-
It cannot show full body or full Authorization token because CF/CDS logs do not contain them. Use `smdg cf request-trace` only when you need experimental deep runtime inspection.
|
|
335
|
-
|
|
336
|
-
# Request Trace Doctor
|
|
337
|
-
|
|
338
|
-
Use this before trying deep body capture:
|
|
339
|
-
|
|
340
|
-
```bash
|
|
341
|
-
smdg cf request-trace-doctor
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
It checks recent router/app traffic and the remote Node process list so you can confirm whether the app is receiving requests and whether deep inspection is possible.
|
|
345
|
-
|
|
346
|
-
# Network Trace
|
|
347
|
-
|
|
348
|
-
```bash
|
|
349
|
-
smdg cf request-trace
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
This command can capture request data from inside a running Node.js/CAP app.
|
|
353
|
-
|
|
354
|
-
Use it when you need more than `smdg cf http-watch`, especially request body for POST/PATCH APIs.
|
|
355
|
-
|
|
356
|
-
Recommended mode:
|
|
357
|
-
|
|
358
|
-
```txt
|
|
359
|
-
Deep Node Inspector trace
|
|
360
|
-
Headers + body
|
|
361
|
-
Mask token
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
The trace is temporary and disappears after the app restarts. It does not change source code.
|
|
365
|
-
|
|
366
|
-
If the CLI cannot reach the Node inspector, run the command again and choose the prepare option that sets `NODE_OPTIONS` and restarts the app.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
# Request Trace Runtime Tools
|
|
370
|
-
|
|
371
|
-
Use this command when you need to inspect real request headers and bodies from a BTP Node.js/CAP app without changing repository source code:
|
|
372
|
-
|
|
373
|
-
```bash
|
|
374
|
-
smdg cf request-trace
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
Alias:
|
|
378
|
-
|
|
379
|
-
```bash
|
|
380
|
-
smdg cf network-trace
|
|
381
|
-
```
|
|
75
|
+
Direct connections are cached and encrypted exactly like imported ones, so they reappear next time you open the Studio.
|
|
382
76
|
|
|
383
|
-
|
|
77
|
+
Console slash commands: `/connect`, `/schemas`, `/tables`, `/desc TABLE`, `/top TABLE`, `/count TABLE`, `/save NAME`, `/history`, `/export csv|json`, `/full`, `/clear`, `/help`, `/exit`.
|
|
384
78
|
|
|
385
|
-
|
|
386
|
-
* trace depth: path, headers, body, or response body
|
|
387
|
-
* Authorization handling: masked, full, or omitted
|
|
388
|
-
* displayed headers: minimal, common, all, or custom
|
|
389
|
-
* whether to parse body as JSON/form data
|
|
390
|
-
* whether to export trace events to a JSONL file
|
|
79
|
+
## DB cache
|
|
391
80
|
|
|
392
|
-
|
|
81
|
+
Connections are cached under:
|
|
393
82
|
|
|
394
|
-
```
|
|
395
|
-
/
|
|
396
|
-
/path getBusinessRequest
|
|
397
|
-
/body CR0000135951
|
|
398
|
-
/status 500
|
|
399
|
-
/text single.npi
|
|
400
|
-
/headers authorization,content-type,x-correlationid,x-vcap-request-id
|
|
401
|
-
/headers all
|
|
402
|
-
/clear
|
|
403
|
-
/show
|
|
404
|
-
/replay
|
|
405
|
-
/pause
|
|
406
|
-
/resume
|
|
407
|
-
/help
|
|
83
|
+
```text
|
|
84
|
+
~/.simplemdg/db-connections.json
|
|
408
85
|
```
|
|
409
86
|
|
|
410
|
-
|
|
87
|
+
Saved queries live in `~/.simplemdg/db-queries/` and history in `~/.simplemdg/db-query-history.json`.
|
|
411
88
|
|
|
412
|
-
|
|
89
|
+
Passwords are encrypted with a key derived from the current Windows user + machine. A cache file copied to another machine cannot be decrypted, and the password is never sent to the browser.
|