@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.
Files changed (114) hide show
  1. package/bin/v8/commands/generateSamples.js +25 -0
  2. package/bin/v8/commands/init.js +23 -0
  3. package/bin/v8/commands/steps/announce.js +3 -0
  4. package/bin/v8/commands/steps/createProject.js +6 -0
  5. package/bin/v8/commands/steps/decideTemplate.js +3 -0
  6. package/bin/v8/commands/steps/locateDestination.js +5 -0
  7. package/bin/v8/commands/steps/locateSource.js +14 -0
  8. package/bin/v8/commands/template/baseTemplate.js +11 -0
  9. package/bin/v8/commands/template/basic/.vscode/launch.json +12 -0
  10. package/bin/v8/commands/template/basic/Config/Schemas/BillsTable.json +165 -0
  11. package/bin/v8/commands/template/basic/Config/Schemas/ItemsTable.json +200 -0
  12. package/bin/v8/commands/template/basic/Config/Schemas/LedgerNames.json +50 -0
  13. package/bin/v8/commands/template/basic/Config/Schemas/StockItems.json +45 -0
  14. package/bin/v8/commands/template/basic/Config/api.json +8 -0
  15. package/bin/v8/commands/template/basic/Config/schema.json +8 -0
  16. package/bin/v8/commands/template/basic/Config/ui.json +8 -0
  17. package/bin/v8/commands/template/basic/Data/BillsTable.json +165 -0
  18. package/bin/v8/commands/template/basic/Data/ItemsTable.json +200 -0
  19. package/bin/v8/commands/template/basic/Data/LedgerNames.json +6 -0
  20. package/bin/v8/commands/template/basic/Data/StockItems.json +45 -0
  21. package/bin/v8/commands/template/basic/app.js +4 -0
  22. package/bin/v8/commands/template/basic/config.json +4 -0
  23. package/bin/v8/commands/template/basic/package-lock.json +21 -0
  24. package/bin/v8/commands/template/basic/package.json +13 -0
  25. package/bin/v8/commands/template/basic/read.js +8 -0
  26. package/bin/v8/commands/template/basic/write.js +8 -0
  27. package/bin/v8/commands/template/express/.env +8 -0
  28. package/bin/v8/commands/template/express/.env.local +7 -0
  29. package/bin/v8/commands/template/express/.vscode/launch.json +12 -0
  30. package/bin/v8/commands/template/express/Config/Schemas/BillsTable.json +166 -0
  31. package/bin/v8/commands/template/express/Config/Schemas/ItemsTable.json +206 -0
  32. package/bin/v8/commands/template/express/Config/Schemas/LedgerNames.json +50 -0
  33. package/bin/v8/commands/template/express/Config/Schemas/StockItems.json +45 -0
  34. package/bin/v8/commands/template/express/Config/api.json +8 -0
  35. package/bin/v8/commands/template/express/Config/schema.json +8 -0
  36. package/bin/v8/commands/template/express/Config/ui.json +8 -0
  37. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/build.js +6 -0
  38. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/config.js +12 -0
  39. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/main.js +29 -0
  40. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/publish.js +22 -0
  41. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/repo.js +20 -0
  42. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/schema.js +16 -0
  43. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/utils.js +26 -0
  44. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/version.js +25 -0
  45. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/buildAndCopy.js +166 -0
  46. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/latestVersion.js +38 -0
  47. package/bin/v8/commands/template/express/ForFrontEnd/Secured/buildProtected.js +108 -0
  48. package/bin/v8/commands/template/express/ForFrontEnd/Secured/latestVersion.js +38 -0
  49. package/bin/v8/commands/template/express/app.js +33 -0
  50. package/bin/v8/commands/template/express/config.json +4 -0
  51. package/bin/v8/commands/template/express/package.json +18 -0
  52. package/bin/v8/commands/test.js +36 -0
  53. package/bin/v8/core/parseInput.js +10 -0
  54. package/bin/v8/core/resolveCommand.js +12 -0
  55. package/bin/v8/core/resolveFolderName.js +17 -0
  56. package/bin/v8/start.js +23 -0
  57. package/bin/v9/commands/generateSamples.js +25 -0
  58. package/bin/v9/commands/init.js +23 -0
  59. package/bin/v9/commands/steps/announce.js +3 -0
  60. package/bin/v9/commands/steps/createProject.js +6 -0
  61. package/bin/v9/commands/steps/decideTemplate.js +3 -0
  62. package/bin/v9/commands/steps/locateDestination.js +5 -0
  63. package/bin/v9/commands/steps/locateSource.js +14 -0
  64. package/bin/v9/commands/template/baseTemplate.js +11 -0
  65. package/bin/v9/commands/template/basic/.vscode/launch.json +12 -0
  66. package/bin/v9/commands/template/basic/Config/Schemas/BillsTable.json +165 -0
  67. package/bin/v9/commands/template/basic/Config/Schemas/ItemsTable.json +200 -0
  68. package/bin/v9/commands/template/basic/Config/Schemas/LedgerNames.json +50 -0
  69. package/bin/v9/commands/template/basic/Config/Schemas/StockItems.json +45 -0
  70. package/bin/v9/commands/template/basic/Config/api.json +8 -0
  71. package/bin/v9/commands/template/basic/Config/schema.json +8 -0
  72. package/bin/v9/commands/template/basic/Config/ui.json +8 -0
  73. package/bin/v9/commands/template/basic/Data/BillsTable.json +165 -0
  74. package/bin/v9/commands/template/basic/Data/ItemsTable.json +200 -0
  75. package/bin/v9/commands/template/basic/Data/LedgerNames.json +6 -0
  76. package/bin/v9/commands/template/basic/Data/StockItems.json +45 -0
  77. package/bin/v9/commands/template/basic/app.js +4 -0
  78. package/bin/v9/commands/template/basic/config.json +4 -0
  79. package/bin/v9/commands/template/basic/package-lock.json +21 -0
  80. package/bin/v9/commands/template/basic/package.json +13 -0
  81. package/bin/v9/commands/template/basic/read.js +8 -0
  82. package/bin/v9/commands/template/basic/write.js +8 -0
  83. package/bin/v9/commands/template/express/.env +8 -0
  84. package/bin/v9/commands/template/express/.env.local +7 -0
  85. package/bin/v9/commands/template/express/.vscode/launch.json +12 -0
  86. package/bin/v9/commands/template/express/Config/Schemas/BillsTable.json +166 -0
  87. package/bin/v9/commands/template/express/Config/Schemas/ItemsTable.json +206 -0
  88. package/bin/v9/commands/template/express/Config/Schemas/LedgerNames.json +50 -0
  89. package/bin/v9/commands/template/express/Config/Schemas/StockItems.json +45 -0
  90. package/bin/v9/commands/template/express/Config/api.json +8 -0
  91. package/bin/v9/commands/template/express/Config/schema.json +8 -0
  92. package/bin/v9/commands/template/express/Config/ui.json +8 -0
  93. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/build.js +6 -0
  94. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/config.js +12 -0
  95. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/main.js +29 -0
  96. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/publish.js +22 -0
  97. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/repo.js +20 -0
  98. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/schema.js +16 -0
  99. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/utils.js +26 -0
  100. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/version.js +25 -0
  101. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/buildAndCopy.js +166 -0
  102. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/latestVersion.js +38 -0
  103. package/bin/v9/commands/template/express/ForFrontEnd/Secured/buildProtected.js +108 -0
  104. package/bin/v9/commands/template/express/ForFrontEnd/Secured/latestVersion.js +38 -0
  105. package/bin/v9/commands/template/express/app.js +33 -0
  106. package/bin/v9/commands/template/express/config.json +4 -0
  107. package/bin/v9/commands/template/express/package.json +18 -0
  108. package/bin/v9/commands/test.js +36 -0
  109. package/bin/v9/core/parseInput.js +10 -0
  110. package/bin/v9/core/resolveCommand.js +13 -0
  111. package/bin/v9/core/resolveFolderName.js +17 -0
  112. package/bin/v9/start.js +23 -0
  113. package/package.json +2 -2
  114. 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();