@keshavsoft/kschema-cli 1.12.8 → 1.12.11

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 (188) hide show
  1. package/bin/cli.js +1 -1
  2. package/bin/v12/commands/exportCommands/tally.js +9 -0
  3. package/bin/v12/commands/tally/template/v3/Api/V1/BillsTable/Config/schema.json +2 -2
  4. package/bin/v12/commands/tally/template/v3/Api/V1/BillsTable/Insert/rest.http +12 -12
  5. package/bin/v12/commands/tally/template/v3/Api/V1/BillsTable/end-points.js +4 -4
  6. package/bin/v12/commands/tally/template/v3/Api/V1/ItemsTable/Config/schema.json +2 -2
  7. package/bin/v12/commands/tally/template/v3/Api/V1/ItemsTable/Insert/rest.http +13 -13
  8. package/bin/v12/commands/tally/template/v3/Api/V1/ItemsTable/end-points.js +4 -4
  9. package/bin/v12/commands/tally/template/v3/Api/V1/LedgerNames/Config/schema.json +2 -2
  10. package/bin/v12/commands/tally/template/v3/Api/V1/LedgerNames/end-points.js +2 -2
  11. package/bin/v12/commands/tally/template/v3/Api/V1/StockItems/Config/schema.json +2 -2
  12. package/bin/v12/commands/tally/template/v3/Api/V1/StockItems/end-points.js +2 -2
  13. package/bin/v12/commands/tally/template/v3/Api/V1/routes.js +8 -8
  14. package/bin/v12/commands/tally/template/v3/Api/routes.js +2 -2
  15. package/bin/v12/commands/tally/template/v3/FromTally/V1/StockItems/Config/schema.json +2 -2
  16. package/bin/v12/commands/tally/template/v3/FromTally/V1/routes.js +2 -2
  17. package/bin/v12/commands/tally/template/v3/app.js +4 -4
  18. package/index.js +10 -2
  19. package/package.json +1 -1
  20. package/bin/v10/commands/generateSamples.js +0 -26
  21. package/bin/v10/commands/init.js +0 -23
  22. package/bin/v10/commands/steps/announce.js +0 -3
  23. package/bin/v10/commands/steps/createProject.js +0 -6
  24. package/bin/v10/commands/steps/decideTemplate.js +0 -3
  25. package/bin/v10/commands/steps/locateDestination.js +0 -5
  26. package/bin/v10/commands/steps/locateSource.js +0 -14
  27. package/bin/v10/commands/template/baseTemplate.js +0 -11
  28. package/bin/v10/commands/template/basic/.vscode/launch.json +0 -12
  29. package/bin/v10/commands/template/basic/Config/Schemas/BillsTable.json +0 -165
  30. package/bin/v10/commands/template/basic/Config/Schemas/ItemsTable.json +0 -200
  31. package/bin/v10/commands/template/basic/Config/Schemas/LedgerNames.json +0 -50
  32. package/bin/v10/commands/template/basic/Config/Schemas/StockItems.json +0 -45
  33. package/bin/v10/commands/template/basic/Config/api.json +0 -8
  34. package/bin/v10/commands/template/basic/Config/schema.json +0 -8
  35. package/bin/v10/commands/template/basic/Config/ui.json +0 -8
  36. package/bin/v10/commands/template/basic/Data/BillsTable.json +0 -165
  37. package/bin/v10/commands/template/basic/Data/ItemsTable.json +0 -200
  38. package/bin/v10/commands/template/basic/Data/LedgerNames.json +0 -6
  39. package/bin/v10/commands/template/basic/Data/StockItems.json +0 -45
  40. package/bin/v10/commands/template/basic/app.js +0 -4
  41. package/bin/v10/commands/template/basic/config.json +0 -4
  42. package/bin/v10/commands/template/basic/package-lock.json +0 -21
  43. package/bin/v10/commands/template/basic/package.json +0 -14
  44. package/bin/v10/commands/template/basic/read.js +0 -8
  45. package/bin/v10/commands/template/basic/write.js +0 -8
  46. package/bin/v10/commands/template/express/.env +0 -8
  47. package/bin/v10/commands/template/express/.env.local +0 -7
  48. package/bin/v10/commands/template/express/.vscode/launch.json +0 -12
  49. package/bin/v10/commands/template/express/Config/Schemas/BillsTable.json +0 -166
  50. package/bin/v10/commands/template/express/Config/Schemas/ItemsTable.json +0 -206
  51. package/bin/v10/commands/template/express/Config/Schemas/LedgerNames.json +0 -50
  52. package/bin/v10/commands/template/express/Config/Schemas/StockItems.json +0 -45
  53. package/bin/v10/commands/template/express/Config/api.json +0 -8
  54. package/bin/v10/commands/template/express/Config/schema.json +0 -8
  55. package/bin/v10/commands/template/express/Config/ui.json +0 -8
  56. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/build.js +0 -6
  57. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/config.js +0 -12
  58. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/main.js +0 -29
  59. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/publish.js +0 -22
  60. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/repo.js +0 -20
  61. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/schema.js +0 -16
  62. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/utils.js +0 -26
  63. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/Builder/version.js +0 -25
  64. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/buildAndCopy.js +0 -166
  65. package/bin/v10/commands/template/express/ForFrontEnd/NonSecured/latestVersion.js +0 -38
  66. package/bin/v10/commands/template/express/ForFrontEnd/Secured/buildProtected.js +0 -108
  67. package/bin/v10/commands/template/express/ForFrontEnd/Secured/latestVersion.js +0 -38
  68. package/bin/v10/commands/template/express/app.js +0 -33
  69. package/bin/v10/commands/template/express/config.json +0 -4
  70. package/bin/v10/commands/template/express/package.json +0 -18
  71. package/bin/v10/commands/test.js +0 -36
  72. package/bin/v10/core/parseInput.js +0 -10
  73. package/bin/v10/core/resolveCommand.js +0 -14
  74. package/bin/v10/core/resolveFolderName.js +0 -17
  75. package/bin/v10/core/showUsage.js +0 -42
  76. package/bin/v10/start.js +0 -22
  77. package/bin/v8/commands/generateSamples.js +0 -25
  78. package/bin/v8/commands/init.js +0 -23
  79. package/bin/v8/commands/steps/announce.js +0 -3
  80. package/bin/v8/commands/steps/createProject.js +0 -6
  81. package/bin/v8/commands/steps/decideTemplate.js +0 -3
  82. package/bin/v8/commands/steps/locateDestination.js +0 -5
  83. package/bin/v8/commands/steps/locateSource.js +0 -14
  84. package/bin/v8/commands/template/baseTemplate.js +0 -11
  85. package/bin/v8/commands/template/basic/.vscode/launch.json +0 -12
  86. package/bin/v8/commands/template/basic/Config/Schemas/BillsTable.json +0 -165
  87. package/bin/v8/commands/template/basic/Config/Schemas/ItemsTable.json +0 -200
  88. package/bin/v8/commands/template/basic/Config/Schemas/LedgerNames.json +0 -50
  89. package/bin/v8/commands/template/basic/Config/Schemas/StockItems.json +0 -45
  90. package/bin/v8/commands/template/basic/Config/api.json +0 -8
  91. package/bin/v8/commands/template/basic/Config/schema.json +0 -8
  92. package/bin/v8/commands/template/basic/Config/ui.json +0 -8
  93. package/bin/v8/commands/template/basic/Data/BillsTable.json +0 -165
  94. package/bin/v8/commands/template/basic/Data/ItemsTable.json +0 -200
  95. package/bin/v8/commands/template/basic/Data/LedgerNames.json +0 -6
  96. package/bin/v8/commands/template/basic/Data/StockItems.json +0 -45
  97. package/bin/v8/commands/template/basic/app.js +0 -4
  98. package/bin/v8/commands/template/basic/config.json +0 -4
  99. package/bin/v8/commands/template/basic/package-lock.json +0 -21
  100. package/bin/v8/commands/template/basic/package.json +0 -13
  101. package/bin/v8/commands/template/basic/read.js +0 -8
  102. package/bin/v8/commands/template/basic/write.js +0 -8
  103. package/bin/v8/commands/template/express/.env +0 -8
  104. package/bin/v8/commands/template/express/.env.local +0 -7
  105. package/bin/v8/commands/template/express/.vscode/launch.json +0 -12
  106. package/bin/v8/commands/template/express/Config/Schemas/BillsTable.json +0 -166
  107. package/bin/v8/commands/template/express/Config/Schemas/ItemsTable.json +0 -206
  108. package/bin/v8/commands/template/express/Config/Schemas/LedgerNames.json +0 -50
  109. package/bin/v8/commands/template/express/Config/Schemas/StockItems.json +0 -45
  110. package/bin/v8/commands/template/express/Config/api.json +0 -8
  111. package/bin/v8/commands/template/express/Config/schema.json +0 -8
  112. package/bin/v8/commands/template/express/Config/ui.json +0 -8
  113. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/build.js +0 -6
  114. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/config.js +0 -12
  115. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/main.js +0 -29
  116. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/publish.js +0 -22
  117. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/repo.js +0 -20
  118. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/schema.js +0 -16
  119. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/utils.js +0 -26
  120. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/Builder/version.js +0 -25
  121. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/buildAndCopy.js +0 -166
  122. package/bin/v8/commands/template/express/ForFrontEnd/NonSecured/latestVersion.js +0 -38
  123. package/bin/v8/commands/template/express/ForFrontEnd/Secured/buildProtected.js +0 -108
  124. package/bin/v8/commands/template/express/ForFrontEnd/Secured/latestVersion.js +0 -38
  125. package/bin/v8/commands/template/express/app.js +0 -33
  126. package/bin/v8/commands/template/express/config.json +0 -4
  127. package/bin/v8/commands/template/express/package.json +0 -18
  128. package/bin/v8/commands/test.js +0 -36
  129. package/bin/v8/core/parseInput.js +0 -10
  130. package/bin/v8/core/resolveCommand.js +0 -12
  131. package/bin/v8/core/resolveFolderName.js +0 -17
  132. package/bin/v8/start.js +0 -23
  133. package/bin/v9/commands/generateSamples.js +0 -26
  134. package/bin/v9/commands/init.js +0 -23
  135. package/bin/v9/commands/steps/announce.js +0 -3
  136. package/bin/v9/commands/steps/createProject.js +0 -6
  137. package/bin/v9/commands/steps/decideTemplate.js +0 -3
  138. package/bin/v9/commands/steps/locateDestination.js +0 -5
  139. package/bin/v9/commands/steps/locateSource.js +0 -14
  140. package/bin/v9/commands/template/baseTemplate.js +0 -11
  141. package/bin/v9/commands/template/basic/.vscode/launch.json +0 -12
  142. package/bin/v9/commands/template/basic/Config/Schemas/BillsTable.json +0 -165
  143. package/bin/v9/commands/template/basic/Config/Schemas/ItemsTable.json +0 -200
  144. package/bin/v9/commands/template/basic/Config/Schemas/LedgerNames.json +0 -50
  145. package/bin/v9/commands/template/basic/Config/Schemas/StockItems.json +0 -45
  146. package/bin/v9/commands/template/basic/Config/api.json +0 -8
  147. package/bin/v9/commands/template/basic/Config/schema.json +0 -8
  148. package/bin/v9/commands/template/basic/Config/ui.json +0 -8
  149. package/bin/v9/commands/template/basic/Data/BillsTable.json +0 -165
  150. package/bin/v9/commands/template/basic/Data/ItemsTable.json +0 -200
  151. package/bin/v9/commands/template/basic/Data/LedgerNames.json +0 -6
  152. package/bin/v9/commands/template/basic/Data/StockItems.json +0 -45
  153. package/bin/v9/commands/template/basic/app.js +0 -4
  154. package/bin/v9/commands/template/basic/config.json +0 -4
  155. package/bin/v9/commands/template/basic/package-lock.json +0 -21
  156. package/bin/v9/commands/template/basic/package.json +0 -13
  157. package/bin/v9/commands/template/basic/read.js +0 -8
  158. package/bin/v9/commands/template/basic/write.js +0 -8
  159. package/bin/v9/commands/template/express/.env +0 -8
  160. package/bin/v9/commands/template/express/.env.local +0 -7
  161. package/bin/v9/commands/template/express/.vscode/launch.json +0 -12
  162. package/bin/v9/commands/template/express/Config/Schemas/BillsTable.json +0 -166
  163. package/bin/v9/commands/template/express/Config/Schemas/ItemsTable.json +0 -206
  164. package/bin/v9/commands/template/express/Config/Schemas/LedgerNames.json +0 -50
  165. package/bin/v9/commands/template/express/Config/Schemas/StockItems.json +0 -45
  166. package/bin/v9/commands/template/express/Config/api.json +0 -8
  167. package/bin/v9/commands/template/express/Config/schema.json +0 -8
  168. package/bin/v9/commands/template/express/Config/ui.json +0 -8
  169. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/build.js +0 -6
  170. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/config.js +0 -12
  171. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/main.js +0 -29
  172. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/publish.js +0 -22
  173. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/repo.js +0 -20
  174. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/schema.js +0 -16
  175. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/utils.js +0 -26
  176. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/Builder/version.js +0 -25
  177. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/buildAndCopy.js +0 -166
  178. package/bin/v9/commands/template/express/ForFrontEnd/NonSecured/latestVersion.js +0 -38
  179. package/bin/v9/commands/template/express/ForFrontEnd/Secured/buildProtected.js +0 -108
  180. package/bin/v9/commands/template/express/ForFrontEnd/Secured/latestVersion.js +0 -38
  181. package/bin/v9/commands/template/express/app.js +0 -33
  182. package/bin/v9/commands/template/express/config.json +0 -4
  183. package/bin/v9/commands/template/express/package.json +0 -18
  184. package/bin/v9/commands/test.js +0 -36
  185. package/bin/v9/core/parseInput.js +0 -10
  186. package/bin/v9/core/resolveCommand.js +0 -14
  187. package/bin/v9/core/resolveFolderName.js +0 -17
  188. package/bin/v9/start.js +0 -63
package/bin/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  import getLatestVersion from "./core/getLatestVersion.js";
4
4
  import loadRunner from "./core/loadRunner.js";
@@ -0,0 +1,9 @@
1
+ import fs from "fs";
2
+
3
+ import { locateSource } from "../tally/steps/locateSource.js";
4
+
5
+ export default (inDestination) => {
6
+ const source = locateSource();
7
+
8
+ fs.cpSync(source, inDestination, { recursive: true });
9
+ };
@@ -1,3 +1,3 @@
1
- {
2
- "tableName": "BillsTable.json"
1
+ {
2
+ "tableName": "BillsTable.json"
3
3
  }
@@ -1,12 +1,12 @@
1
-
2
- POST http://localhost:3000/Api/V1/BillsTable/Insert
3
- Content-Type: application/json
4
-
5
- {
6
- "LedgerName": "",
7
- "LedgerParentName": "",
8
- "LedgerGST": "",
9
- "InvoiceNo": "",
10
- "InvoiceDate": "",
11
- "InvoiceStateCode": ""
12
- }
1
+
2
+ POST http://localhost:3000/Api/V1/BillsTable/Insert
3
+ Content-Type: application/json
4
+
5
+ {
6
+ "LedgerName": "",
7
+ "LedgerParentName": "",
8
+ "LedgerGST": "",
9
+ "InvoiceNo": "",
10
+ "InvoiceDate": "",
11
+ "InvoiceStateCode": ""
12
+ }
@@ -1,11 +1,11 @@
1
- import express from 'express';
2
- import { postFunc } from "./Insert/controller.js";
1
+ import express from 'express';
2
+ import { postFunc } from "./Insert/controller.js";
3
3
  import { findFunc } from "./Find/controller.js";
4
4
 
5
5
  const tableName = "BillsTable";
6
6
 
7
- const router = express.Router();
8
- router.get('/Find/:pk', (req, res) => findFunc({ req, res, inTableName: tableName }));
7
+ const router = express.Router();
8
+ router.get('/Find/:pk', (req, res) => findFunc({ req, res, inTableName: tableName }));
9
9
  router.post('/Insert', express.json(), (req, res) => postFunc({ req, res, inTableName: tableName }));
10
10
 
11
11
  export { router };
@@ -1,3 +1,3 @@
1
- {
2
- "tableName": "ItemsTable.json"
1
+ {
2
+ "tableName": "ItemsTable.json"
3
3
  }
@@ -1,13 +1,13 @@
1
-
2
- POST http://localhost:3000/Api/V1/ItemsTable/Insert
3
- Content-Type: application/json
4
-
5
- {
6
- "StockItemName": "",
7
- "Rate": "",
8
- "Qty": "",
9
- "Amount": "",
10
- "TaxPer": "",
11
- "Uom": "",
12
- "ParentPk": ""
13
- }
1
+
2
+ POST http://localhost:3000/Api/V1/ItemsTable/Insert
3
+ Content-Type: application/json
4
+
5
+ {
6
+ "StockItemName": "",
7
+ "Rate": "",
8
+ "Qty": "",
9
+ "Amount": "",
10
+ "TaxPer": "",
11
+ "Uom": "",
12
+ "ParentPk": ""
13
+ }
@@ -1,11 +1,11 @@
1
- import express from 'express';
2
- import { filterColumnsFunc } from "./FilterColumns/controller.js";
1
+ import express from 'express';
2
+ import { filterColumnsFunc } from "./FilterColumns/controller.js";
3
3
  import { postFunc } from "./Insert/controller.js";
4
4
 
5
5
  const tableName = "ItemsTable";
6
6
 
7
- const router = express.Router();
8
- router.post('/Insert', express.json(), (req, res) => postFunc({ req, res, inTableName: tableName }));
7
+ const router = express.Router();
8
+ router.post('/Insert', express.json(), (req, res) => postFunc({ req, res, inTableName: tableName }));
9
9
  router.get('/FilterColumns', (req, res) => filterColumnsFunc({ req, res, inTableName: tableName }));
10
10
 
11
11
  export { router };
@@ -1,3 +1,3 @@
1
- {
2
- "tableName": "LedgerNames.json"
1
+ {
2
+ "tableName": "LedgerNames.json"
3
3
  }
@@ -1,9 +1,9 @@
1
- import express from 'express';
1
+ import express from 'express';
2
2
  import { getFunc } from "./ShowAll/controller.js";
3
3
 
4
4
  const tableName = "LedgerNames";
5
5
 
6
- const router = express.Router();
6
+ const router = express.Router();
7
7
  router.get('/ShowAll', (req, res) => getFunc({ res, inTableName : tableName}));
8
8
 
9
9
  export { router };
@@ -1,3 +1,3 @@
1
- {
2
- "tableName": "StockItems.json"
1
+ {
2
+ "tableName": "StockItems.json"
3
3
  }
@@ -1,9 +1,9 @@
1
- import express from 'express';
1
+ import express from 'express';
2
2
  import { getFunc } from "./ShowAll/controller.js";
3
3
 
4
4
  const tableName = "StockItems";
5
5
 
6
- const router = express.Router();
6
+ const router = express.Router();
7
7
  router.get('/ShowAll', (req, res) => getFunc({ res, inTableName : tableName}));
8
8
 
9
9
  export { router };
@@ -1,13 +1,13 @@
1
- import express from 'express';
2
- import { router as routerFromLedgerNames } from "./LedgerNames/end-points.js";
3
- import { router as routerFromStockItems } from "./StockItems/end-points.js";
4
- import { router as routerFromBillsTable } from "./BillsTable/end-points.js";
1
+ import express from 'express';
2
+ import { router as routerFromLedgerNames } from "./LedgerNames/end-points.js";
3
+ import { router as routerFromStockItems } from "./StockItems/end-points.js";
4
+ import { router as routerFromBillsTable } from "./BillsTable/end-points.js";
5
5
  import { router as routerFromItemsTable } from "./ItemsTable/end-points.js";
6
6
 
7
7
  const router = express.Router();
8
- router.use('/LedgerNames', routerFromLedgerNames);
9
- router.use('/StockItems', routerFromStockItems);
10
- router.use('/BillsTable', routerFromBillsTable);
11
- router.use('/ItemsTable', routerFromItemsTable);
8
+ router.use('/LedgerNames', routerFromLedgerNames);
9
+ router.use('/StockItems', routerFromStockItems);
10
+ router.use('/BillsTable', routerFromBillsTable);
11
+ router.use('/ItemsTable', routerFromItemsTable);
12
12
 
13
13
  export { router };
@@ -1,7 +1,7 @@
1
- import express from 'express';
1
+ import express from 'express';
2
2
  import { router as routerFromV1 } from "./V1/routes.js";
3
3
 
4
4
  const router = express.Router();
5
- router.use('/V1', routerFromV1);
5
+ router.use('/V1', routerFromV1);
6
6
 
7
7
  export { router };
@@ -1,3 +1,3 @@
1
- {
2
- "tableName": "StockItems.json"
1
+ {
2
+ "tableName": "StockItems.json"
3
3
  }
@@ -1,11 +1,11 @@
1
1
  import express from 'express';
2
2
 
3
- import { router as routerFromLedgerNames } from "./LedgerNames/end-points.js";
3
+ import { router as routerFromLedgerNames } from "./LedgerNames/end-points.js";
4
4
  import { router as routerFromStockItems } from "./StockItems/end-points.js";
5
5
 
6
6
  const router = express.Router();
7
7
 
8
8
  router.use('/LedgerNames', routerFromLedgerNames);
9
- router.use('/StockItems', routerFromStockItems);
9
+ router.use('/StockItems', routerFromStockItems);
10
10
 
11
11
  export { router };
@@ -6,14 +6,14 @@ import loadConfig from "./configLoader.js";
6
6
  import setupRoutes from "./routes.js";
7
7
  import startServer from "./server.js";
8
8
 
9
- import { router as routerFromFromTally } from "./FromTally/routes.js";
10
- import { router as routerFromApi } from "./Api/routes.js";
9
+ import { router as routerFromFromTally } from "./FromTally/routes.js";
10
+ import { router as routerFromApi } from "./Api/routes.js";
11
11
  import { router as routerFromV7 } from "./V7/routes.js";
12
12
 
13
13
  loadConfig();
14
14
 
15
- const app = express()
16
- app.use("/V7", routerFromV7);
15
+ const app = express()
16
+ app.use("/V7", routerFromV7);
17
17
  app.use("/Api", routerFromApi);
18
18
 
19
19
  app.use("/FromTally", routerFromFromTally);
package/index.js CHANGED
@@ -1,2 +1,10 @@
1
- export { default as init } from "./bin/v12/commands/exportCommands/init.js";
2
- export { default as express } from "./bin/v12/commands/exportCommands/express.js";
1
+ import getLatestVersion from "./bin/core/getLatestVersion.js";
2
+
3
+ const load = async (cmd) => {
4
+ const v = getLatestVersion();
5
+ return (await import(`./bin/${v}/commands/exportCommands/${cmd}.js`)).default;
6
+ };
7
+
8
+ export const express = async (...a) => (await load("express"))(...a);
9
+ export const init = async (...a) => (await load("init"))(...a);
10
+ export const tally = async (...a) => (await load("tally"))(...a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keshavsoft/kschema-cli",
3
- "version": "1.12.8",
3
+ "version": "1.12.11",
4
4
  "description": "CLI to scaffold projects using templates",
5
5
  "keywords": [
6
6
  "cli",
@@ -1,26 +0,0 @@
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
- export default ({ args }) => {
8
- const OUTPUT_DIR = path.resolve(process.cwd(), "samples");
9
-
10
- if (!fs.existsSync(OUTPUT_DIR)) {
11
- fs.mkdirSync(OUTPUT_DIR, { recursive: true });
12
- };
13
-
14
- Object.entries(exampleSchema).forEach(([intent, methods]) => {
15
- Object.entries(methods).forEach(([key, meta]) => {
16
- if (Array.isArray(meta)) {
17
- const finalCode = baseTemplate({
18
- body: meta.join("\r\n"),
19
- inTableName: args[0]
20
- });
21
-
22
- fs.writeFileSync(path.join(OUTPUT_DIR, `${intent}_${key}.js`), finalCode);
23
- };
24
- });
25
- });
26
- };
@@ -1,23 +0,0 @@
1
- import { decideTemplate } from "./steps/decideTemplate.js";
2
-
3
- import { locateSource } from "./steps/locateSource.js";
4
- import { locateDestination } from "./steps/locateDestination.js";
5
- import { createProject } from "./steps/createProject.js";
6
- import { announce } from "./steps/announce.js";
7
-
8
- import resolveFolderName from "../core/resolveFolderName.js";
9
-
10
- export default ({ template, folderName }) => {
11
- const finalTemplate = decideTemplate({ inTemplate: template });
12
-
13
- const resolvedFolderName = resolveFolderName({
14
- name: folderName
15
- });
16
-
17
- const source = locateSource({ template: finalTemplate });
18
- const destination = locateDestination({ inResolvedFolderName: resolvedFolderName });
19
-
20
- createProject({ source, destination });
21
-
22
- announce({ inResolvedFolderName: resolvedFolderName });
23
- };
@@ -1,3 +0,0 @@
1
- export const announce = ({ inResolvedFolderName }) => {
2
- console.log(`[keshavsoft] Project created: ${inResolvedFolderName}`);
3
- };
@@ -1,6 +0,0 @@
1
- import fs from "fs";
2
-
3
- export const createProject = ({ source, destination }) => {
4
- fs.mkdirSync(destination, { recursive: true });
5
- fs.cpSync(source, destination, { recursive: true });
6
- };
@@ -1,3 +0,0 @@
1
- export const decideTemplate = ({ inTemplate }) => {
2
- return inTemplate || "basic";
3
- };
@@ -1,5 +0,0 @@
1
- import path from "path";
2
-
3
- export const locateDestination = ({ inResolvedFolderName }) => {
4
- return path.join(process.cwd(), inResolvedFolderName);
5
- };
@@ -1,14 +0,0 @@
1
- import path from "path";
2
- import { fileURLToPath } from "url";
3
-
4
- const __filename = fileURLToPath(import.meta.url);
5
- const __dirname = path.dirname(__filename);
6
-
7
- export const locateSource = ({ template }) => {
8
- return path.join(
9
- __dirname,
10
- "..",
11
- "template",
12
- template === "express" ? "express" : "basic"
13
- );
14
- };
@@ -1,11 +0,0 @@
1
- export const baseTemplate = ({ body, inTableName = "SampleTable" }) => `
2
- import { kschema } from "@keshavsoft/kschema";
3
-
4
- import configJson from "../config.json" with { type: "json" };
5
-
6
- kschema.loadConfig(configJson);
7
-
8
- const table = kschema.table("${inTableName}");
9
-
10
- ${body}
11
- `;
@@ -1,12 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "launch",
7
- "name": "Debug App",
8
- "program": "${workspaceFolder}/app.js",
9
- "envFile": "${workspaceFolder}/.env"
10
- }
11
- ]
12
- }
@@ -1,165 +0,0 @@
1
- {
2
- "tableName": "BillsTable",
3
- "columns": [
4
- {
5
- "field": "LedgerName",
6
- "title": "LedgerName",
7
- "type": "text",
8
- "isInput": false,
9
- "isAutoFocus": true,
10
- "WidthOptions": {
11
- "inPx": 200
12
- },
13
- "defaultvalue": "Keshav",
14
- "isDataList": true,
15
- "dataListId": "LedgerNames",
16
- "isConsider": true
17
- },
18
- {
19
- "field": "LedgerParentName",
20
- "title": "LedgerParentName",
21
- "type": "text",
22
- "isInput": true,
23
- "WidthOptions": {
24
- "inPx": 200
25
- },
26
- "isConsider": true,
27
- "showInUi": false
28
- },
29
- {
30
- "field": "LedgerGST",
31
- "title": "LedgerGST",
32
- "type": "text",
33
- "isInput": true,
34
- "isAutoFocus": true,
35
- "WidthOptions": {
36
- "inPx": 200
37
- },
38
- "isConsider": true,
39
- "showInUi": false
40
- },
41
- {
42
- "field": "InvoiceNo",
43
- "title": "InvoiceNo",
44
- "type": "number",
45
- "isInput": true,
46
- "WidthOptions": {
47
- "inPx": 200
48
- },
49
- "isConsider": true
50
- },
51
- {
52
- "field": "InvoiceDate",
53
- "title": "InvoiceDate",
54
- "isDate": true,
55
- "type": "date",
56
- "WidthOptions": {
57
- "inPx": 200
58
- },
59
- "defaultvalue": "today",
60
- "isConsider": true
61
- },
62
- {
63
- "field": "InvoiceStateCode",
64
- "title": "InvoiceStateCode",
65
- "defaultvalue": "37",
66
- "isInput": true,
67
- "WidthOptions": {
68
- "inPx": 200
69
- },
70
- "isConsider": true,
71
- "showInUi": false
72
- },
73
- {
74
- "field": "pk",
75
- "title": "pk",
76
- "primary": true
77
- }
78
- ],
79
- "data": [],
80
- "Vertical": [
81
- {
82
- "field": "LedgerName",
83
- "title": "LedgerName",
84
- "type": "text",
85
- "isInput": false,
86
- "isAutoFocus": true,
87
- "WidthOptions": {
88
- "inPx": 200
89
- },
90
- "defaultvalue": "Keshav",
91
- "isDataList": true,
92
- "dataListId": "LedgerNames"
93
- },
94
- {
95
- "field": "LedgerParentName",
96
- "title": "LedgerParentName",
97
- "type": "text",
98
- "isInput": true,
99
- "WidthOptions": {
100
- "inPx": 200
101
- }
102
- },
103
- {
104
- "field": "LedgerGST",
105
- "title": "LedgerGST",
106
- "type": "text",
107
- "isInput": true,
108
- "isAutoFocus": true,
109
- "WidthOptions": {
110
- "inPx": 200
111
- }
112
- },
113
- {
114
- "field": "InvoiceNo",
115
- "title": "InvoiceNo",
116
- "type": "number",
117
- "isInput": true,
118
- "WidthOptions": {
119
- "inPx": 200
120
- }
121
- },
122
- {
123
- "field": "InvoiceDate",
124
- "title": "InvoiceDate",
125
- "isDate": true,
126
- "type": "date",
127
- "WidthOptions": {
128
- "inPx": 200
129
- },
130
- "defaultvalue": "today"
131
- },
132
- {
133
- "field": "InvoiceStateCode",
134
- "title": "InvoiceStateCode",
135
- "defaultvalue": "37",
136
- "isInput": true,
137
- "WidthOptions": {
138
- "inPx": 200
139
- }
140
- }
141
- ],
142
- "DataTableOptions": {
143
- "Header": {
144
- "autoFocus": "LedgerName"
145
- }
146
- },
147
- "ForeignkeyTables": [
148
- "ItemsTable"
149
- ],
150
- "DependantTables": [
151
- "LedgerNames"
152
- ],
153
- "NonSecured": {
154
- "SubRoutes": [
155
- "ShowAll",
156
- "Insert",
157
- "Find",
158
- "InsertAndReturnPk",
159
- "FindWithForeignData",
160
- "InsertToTally"
161
- ]
162
- },
163
- "PrimarykeyTableNames": [],
164
- "PrimarykeyTables": []
165
- }