@keshavsoft/kschema-cli 1.7.2 → 1.9.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/bin/v8/commands/generateSamples.js +25 -0
- package/bin/v8/commands/init.js +23 -0
- package/bin/v8/commands/steps/announce.js +3 -0
- package/bin/v8/commands/steps/createProject.js +6 -0
- package/bin/v8/commands/steps/decideTemplate.js +3 -0
- package/bin/v8/commands/steps/locateDestination.js +5 -0
- package/bin/v8/commands/steps/locateSource.js +14 -0
- package/bin/v8/commands/template/baseTemplate.js +11 -0
- package/bin/v8/commands/template/basic/.vscode/launch.json +12 -0
- package/bin/v8/commands/template/basic/Config/Schemas/BillsTable.json +165 -0
- package/bin/v8/commands/template/basic/Config/Schemas/ItemsTable.json +200 -0
- package/bin/v8/commands/template/basic/Config/Schemas/LedgerNames.json +50 -0
- package/bin/v8/commands/template/basic/Config/Schemas/StockItems.json +45 -0
- package/bin/v8/commands/template/basic/Config/api.json +8 -0
- package/bin/v8/commands/template/basic/Config/schema.json +8 -0
- package/bin/v8/commands/template/basic/Config/ui.json +8 -0
- package/bin/v8/commands/template/basic/Data/BillsTable.json +165 -0
- package/bin/v8/commands/template/basic/Data/ItemsTable.json +200 -0
- package/bin/v8/commands/template/basic/Data/LedgerNames.json +6 -0
- package/bin/v8/commands/template/basic/Data/StockItems.json +45 -0
- package/bin/v8/commands/template/basic/app.js +4 -0
- package/bin/v8/commands/template/basic/config.json +4 -0
- package/bin/v8/commands/template/basic/package-lock.json +21 -0
- package/bin/v8/commands/template/basic/package.json +13 -0
- package/bin/v8/commands/template/basic/read.js +8 -0
- package/bin/v8/commands/template/basic/write.js +8 -0
- package/bin/v8/commands/template/express/.env +8 -0
- package/bin/v8/commands/template/express/.env.local +7 -0
- package/bin/v8/commands/template/express/.vscode/launch.json +12 -0
- package/bin/v8/commands/template/express/Config/Schemas/BillsTable.json +166 -0
- package/bin/v8/commands/template/express/Config/Schemas/ItemsTable.json +206 -0
- package/bin/v8/commands/template/express/Config/Schemas/LedgerNames.json +50 -0
- package/bin/v8/commands/template/express/Config/Schemas/StockItems.json +45 -0
- package/bin/v8/commands/template/express/Config/api.json +8 -0
- package/bin/v8/commands/template/express/Config/schema.json +8 -0
- package/bin/v8/commands/template/express/Config/ui.json +8 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/build.js +6 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/config.js +12 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/main.js +29 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/publish.js +22 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/repo.js +20 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/schema.js +16 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/utils.js +26 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/version.js +25 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/buildAndCopy.js +166 -0
- package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/latestVersion.js +38 -0
- package/bin/v8/commands/template/express/ForFrontEnd/Secured/buildProtected.js +108 -0
- package/bin/v8/commands/template/express/ForFrontEnd/Secured/latestVersion.js +38 -0
- package/bin/v8/commands/template/express/app.js +33 -0
- package/bin/v8/commands/template/express/config.json +4 -0
- package/bin/v8/commands/template/express/package.json +18 -0
- package/bin/v8/commands/test.js +36 -0
- package/bin/v8/core/parseInput.js +10 -0
- package/bin/v8/core/resolveCommand.js +12 -0
- package/bin/v8/core/resolveFolderName.js +17 -0
- package/bin/v8/start.js +23 -0
- package/bin/v9/commands/generateSamples.js +25 -0
- package/bin/v9/commands/init.js +23 -0
- package/bin/v9/commands/steps/announce.js +3 -0
- package/bin/v9/commands/steps/createProject.js +6 -0
- package/bin/v9/commands/steps/decideTemplate.js +3 -0
- package/bin/v9/commands/steps/locateDestination.js +5 -0
- package/bin/v9/commands/steps/locateSource.js +14 -0
- package/bin/v9/commands/template/baseTemplate.js +11 -0
- package/bin/v9/commands/template/basic/.vscode/launch.json +12 -0
- package/bin/v9/commands/template/basic/Config/Schemas/BillsTable.json +165 -0
- package/bin/v9/commands/template/basic/Config/Schemas/ItemsTable.json +200 -0
- package/bin/v9/commands/template/basic/Config/Schemas/LedgerNames.json +50 -0
- package/bin/v9/commands/template/basic/Config/Schemas/StockItems.json +45 -0
- package/bin/v9/commands/template/basic/Config/api.json +8 -0
- package/bin/v9/commands/template/basic/Config/schema.json +8 -0
- package/bin/v9/commands/template/basic/Config/ui.json +8 -0
- package/bin/v9/commands/template/basic/Data/BillsTable.json +165 -0
- package/bin/v9/commands/template/basic/Data/ItemsTable.json +200 -0
- package/bin/v9/commands/template/basic/Data/LedgerNames.json +6 -0
- package/bin/v9/commands/template/basic/Data/StockItems.json +45 -0
- package/bin/v9/commands/template/basic/app.js +4 -0
- package/bin/v9/commands/template/basic/config.json +4 -0
- package/bin/v9/commands/template/basic/package-lock.json +21 -0
- package/bin/v9/commands/template/basic/package.json +13 -0
- package/bin/v9/commands/template/basic/read.js +8 -0
- package/bin/v9/commands/template/basic/write.js +8 -0
- package/bin/v9/commands/template/express/.env +8 -0
- package/bin/v9/commands/template/express/.env.local +7 -0
- package/bin/v9/commands/template/express/.vscode/launch.json +12 -0
- package/bin/v9/commands/template/express/Config/Schemas/BillsTable.json +166 -0
- package/bin/v9/commands/template/express/Config/Schemas/ItemsTable.json +206 -0
- package/bin/v9/commands/template/express/Config/Schemas/LedgerNames.json +50 -0
- package/bin/v9/commands/template/express/Config/Schemas/StockItems.json +45 -0
- package/bin/v9/commands/template/express/Config/api.json +8 -0
- package/bin/v9/commands/template/express/Config/schema.json +8 -0
- package/bin/v9/commands/template/express/Config/ui.json +8 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/build.js +6 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/config.js +12 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/main.js +29 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/publish.js +22 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/repo.js +20 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/schema.js +16 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/utils.js +26 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/version.js +25 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/buildAndCopy.js +166 -0
- package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/latestVersion.js +38 -0
- package/bin/v9/commands/template/express/ForFrontEnd/Secured/buildProtected.js +108 -0
- package/bin/v9/commands/template/express/ForFrontEnd/Secured/latestVersion.js +38 -0
- package/bin/v9/commands/template/express/app.js +33 -0
- package/bin/v9/commands/template/express/config.json +4 -0
- package/bin/v9/commands/template/express/package.json +18 -0
- package/bin/v9/commands/test.js +36 -0
- package/bin/v9/core/parseInput.js +10 -0
- package/bin/v9/core/resolveCommand.js +13 -0
- package/bin/v9/core/resolveFolderName.js +17 -0
- package/bin/v9/start.js +23 -0
- package/package.json +2 -2
- package/read.js +29 -0
package/read.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { exampleSchema } from "@keshavsoft/kschema";
|
|
5
|
+
import { baseTemplate } from "./template/baseTemplate.js";
|
|
6
|
+
|
|
7
|
+
// console.log("aaaaaaaaa : ", exampleSchema);
|
|
8
|
+
|
|
9
|
+
const runQuery = () => {
|
|
10
|
+
const OUTPUT_DIR = path.resolve(process.cwd(), "samples");
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(OUTPUT_DIR)) {
|
|
13
|
+
fs.mkdirSync(OUTPUT_DIR, { recursive: true });
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
Object.entries(exampleSchema).forEach(([intent, methods]) => {
|
|
17
|
+
Object.entries(methods).forEach(([key, meta]) => {
|
|
18
|
+
|
|
19
|
+
const finalCode = baseTemplate({ body: meta.body });
|
|
20
|
+
|
|
21
|
+
fs.writeFileSync(path.join(OUTPUT_DIR, `${intent}_${key}.js`), finalCode);
|
|
22
|
+
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
runQuery();
|