@t0.labs/daxta 0.4.0 → 0.4.1
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 +19 -18
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -4,21 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
Swagger asks you to decorate controllers. DAxTA learns from what your tests actually call.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
<img src="assets/readme/docs-overview.png" alt="DAxTA docs — recorded request, response, Try-it" width="920" />
|
|
9
|
-
</p>
|
|
7
|
+
DAxTA docs — recorded request, response, Try-it
|
|
10
8
|
|
|
11
9
|
## What you get
|
|
12
10
|
|
|
13
|
-
| After tests | On the app |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| OpenAPI + HTML from real hits | `/docs` on the same port as Nest |
|
|
16
|
-
| Success / validation / auth scenarios | Send + Copy cURL from recorded calls |
|
|
17
|
-
| DTO field map (required vs optional) | `DAXTA_DOCS=true\|false` gate (like Swagger’s prod check) |
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
| After tests | On the app |
|
|
13
|
+
| ------------------------------------- | -------------------------------------------------------- |
|
|
14
|
+
| OpenAPI + HTML from real hits | `/docs` on the same port as Nest |
|
|
15
|
+
| Success / validation / auth scenarios | Send + Copy cURL from recorded calls |
|
|
16
|
+
| DTO field map (required vs optional) | `DAXTA_DOCS=true|false` gate (like Swagger’s prod check) |
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Jest finishes — Docs ready on /docs
|
|
22
20
|
|
|
23
21
|
## How it works
|
|
24
22
|
|
|
@@ -37,7 +35,9 @@ Swagger asks you to decorate controllers. DAxTA learns from what your tests actu
|
|
|
37
35
|
|
|
38
36
|
1. **Install** attaches DAxTA as a Jest plugin (`setupFilesAfterEnv` + reporter). Your existing `test:integration` stays the entrypoint — DAxTA does not wrap the process.
|
|
39
37
|
2. **During the run** only traffic is recorded (disk flush). OpenAPI/HTML is built once when Jest finishes.
|
|
40
|
-
3.
|
|
38
|
+
3. `apiDocs(app)` in `main.ts` serves the generated viewer when `DAXTA_DOCS=true`.
|
|
39
|
+
|
|
40
|
+
|
|
41
41
|
|
|
42
42
|
## Install
|
|
43
43
|
|
|
@@ -60,19 +60,17 @@ pnpm run test:integration # Docs ready when Jest finishes
|
|
|
60
60
|
DAXTA_DOCS=true pnpm start:dev # open /docs on the app port
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
|
|
64
|
+
|
|
63
65
|
## Docs UI
|
|
64
66
|
|
|
65
67
|
Recorded scenarios (success, validation, missing auth) stay tied to the request that produced them — headers included. Empty auth on a 401 scenario stays empty; env tokens only override keys that were actually recorded.
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
<img src="assets/readme/docs-scenarios.png" alt="Scenario picker — success, validation, auth" width="920" />
|
|
69
|
-
</p>
|
|
69
|
+
Scenario picker — success, validation, auth
|
|
70
70
|
|
|
71
71
|
Field metadata comes from class-validator / class-transformer DTOs plus observed traffic:
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
<img src="assets/readme/docs-fields.png" alt="Required vs optional DTO fields" width="640" />
|
|
75
|
-
</p>
|
|
73
|
+
Required vs optional DTO fields
|
|
76
74
|
|
|
77
75
|
## `DAXTA_DOCS` (required)
|
|
78
76
|
|
|
@@ -97,6 +95,8 @@ daxta fields … # export field map for an operation
|
|
|
97
95
|
daxta call … # CLI Try-it
|
|
98
96
|
```
|
|
99
97
|
|
|
98
|
+
|
|
99
|
+
|
|
100
100
|
## API
|
|
101
101
|
|
|
102
102
|
```ts
|
|
@@ -106,3 +106,4 @@ apiDocs(app); // preferred — same origin as the API
|
|
|
106
106
|
app.use(apiDocsHandler()); // Express-style mount
|
|
107
107
|
serveApiDocs({ port: 5199 }); // standalone (CLI / rare)
|
|
108
108
|
```
|
|
109
|
+
|
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t0.labs/daxta",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "DAxTA \u2014 docs from Nest integration traffic + DTO field CLI / Try-it",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/t0-labs/daxta.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/t0-labs/daxta#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/t0-labs/daxta/issues"
|
|
13
|
+
},
|
|
6
14
|
"main": "dist/index.js",
|
|
7
15
|
"types": "dist/index.d.ts",
|
|
8
16
|
"bin": {
|