cap-mock-generator 1.0.0 → 1.0.2
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 +38 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# CAP Mock Generator 🚀
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/cap-mock-generator)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
An advanced, interactive, and intelligent mock dataset generation engine built specifically for **SAP Business Technology Platform (BTP) Cloud Application Programming Model (CAP)** applications.
|
|
7
|
+
|
|
8
|
+
`cap-mock-generator` parses your native `.cds` schemas and populates your `db/data/` folder with highly realistic, relationally consistent `.csv` mock files in seconds, using either a cutting-edge **AI Smart Layer** or a high-speed **Local Fallback Engine**.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ✨ Features
|
|
13
|
+
|
|
14
|
+
- **Interactive Onboarding Wizard:** Powered by modern `@inquirer/prompts`, walking you seamlessly through configuration step-by-step.
|
|
15
|
+
- **Relational Data Integrity (Foreign Key Management):** Automatically analyzes dependencies. It ensures child tables (e.g., entity relationships ending with `ID`) match valid, existing primary keys generated from parent tables.
|
|
16
|
+
- **Automatic Virtual Column Stripping:** Cleanly filters out `Association to many` and `Composition of many` virtual elements so they never mess up your physical CSV deployment files.
|
|
17
|
+
- **Multi-Provider AI Data Layer:** High-fidelity business mock data using either **Google Gemini Pro (`gemini-2.5-flash`)** or **OpenAI (`gpt-4o-mini`)** structured JSON responses.
|
|
18
|
+
- **Resilient Fallback Core:** If your AI API tokens hit limit caps or encounter network spikes ($503$ Service Unavailable), the engine gracefully falls back to a lightning-fast local **Faker.js** cluster without crashing.
|
|
19
|
+
- **Clean Architectural Foundations:** Designed around the Command-Service pattern for maximum scalability and maintainability.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🏗️ Relational Schema Topology
|
|
24
|
+
|
|
25
|
+
The generator intelligently tracks schema hierarchy. Take this complex manufacturing scenario:
|
|
26
|
+
|
|
27
|
+
```cds
|
|
28
|
+
entity Plants {
|
|
29
|
+
key ID : UUID;
|
|
30
|
+
name : String(100);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
entity Assets {
|
|
34
|
+
key ID : UUID;
|
|
35
|
+
plantID : UUID; // Foreign Key referencing Plants
|
|
36
|
+
name : String(100);
|
|
37
|
+
}
|
|
38
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cap-mock-generator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Advanced interactive smart mock dataset generation engine for SAP BTP CAP applications.",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
"@types/node": "^25.9.2",
|
|
43
43
|
"typescript": "^6.0.3"
|
|
44
44
|
}
|
|
45
|
-
}
|
|
45
|
+
}
|