Codebase Architecture
The library dynamically resolves active generators from the latest version runtime folder (e.g. v14) during execution. This allows isolating upgrades safely without breaking older programmatic integrations.
Programmatic Invocation (index.js)
│
├──► Loads getLatestVersion() (resolves e.g. "v14")
│
├─► [withMail] ──► (bin/v14/tasks/actions/withMail.js)
├─► [insertGenPk] ──► (bin/v14/tasks/actions/insertGenPk.js)
├─► [insertAsIs] ──► (bin/v14/tasks/actions/insertAsIs.js)
├─► [filter] ──► (bin/v14/tasks/actions/filter.js)
└─► [groupBy] ──► (bin/v14/tasks/actions/groupBy.js)
Directory Structure
Understanding the location of modules, common code templates, and scaffolding scripts:
kschema-fs-api-gen-post-actions/
├── index.js # Programmatic exports entrypoint
├── package.json # Dependencies mapping
└── bin/
├── core/
│ └── getLatestVersion.js # Checks highest version directory (e.g., v14)
└── v14/
├── core/
│ └── createFolder.js # Helper copy utility
└── tasks/
├── common/
│ └── updateEndPointsJs.js
└── actions/
├── filter.js
├── Filter/ # Templates folder for Filter
├── insertAsIs.js
├── InsertAsIs/
└── ...
Important Libraries & Extensions
Our code actions utilize sub-modules to alter routers or generate schema assets:
🛠 express-fix-endpoints-post-js
Parses and safely appends ES imports and middleware handlers directly into the target project's endpoints router.
📦 kschema-fs-api-gen-rest
Scaffolds matching database CRUD and REST specification endpoints dynamically when generation options are specified.
Local Testing Harness
Developers can test actions locally against dummy targets inside the test/ directory without publishing updates to the registry:
# Execute a specific action test wrapper locally
node test/v4/InsertAsIs/test.js
node test/v4/groupBy/test.js