@keshavsoft/kschema-cli 1.13.2 → 1.13.5

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 (65) hide show
  1. package/bin/v13/commands/accounts/steps/announce.js +3 -0
  2. package/bin/v13/commands/accounts/steps/createProject.js +7 -0
  3. package/bin/v13/commands/accounts/steps/locateDestination.js +5 -0
  4. package/bin/v13/commands/accounts/steps/locateSource.js +16 -0
  5. package/bin/v13/commands/accounts/template/v6/.env +9 -0
  6. package/bin/v13/commands/accounts/template/v6/.env.local +7 -0
  7. package/bin/v13/commands/accounts/template/v6/.vscode/launch.json +12 -0
  8. package/bin/v13/commands/accounts/template/v6/Config/Schemas/BillsTable.json +165 -0
  9. package/bin/v13/commands/accounts/template/v6/Config/Schemas/ItemsTable.json +200 -0
  10. package/bin/v13/commands/accounts/template/v6/Config/Schemas/LedgerNames.json +60 -0
  11. package/bin/v13/commands/accounts/template/v6/Config/Schemas/StockItems.json +50 -0
  12. package/bin/v13/commands/accounts/template/v6/Config/api.json +8 -0
  13. package/bin/v13/commands/accounts/template/v6/Config/schema.json +8 -0
  14. package/bin/v13/commands/accounts/template/v6/Config/ui.json +8 -0
  15. package/bin/v13/commands/accounts/template/v6/Public/index.html +129 -0
  16. package/bin/v13/commands/accounts/template/v6/app.js +19 -0
  17. package/bin/v13/commands/accounts/template/v6/config.json +4 -0
  18. package/bin/v13/commands/accounts/template/v6/configLoader.js +6 -0
  19. package/bin/v13/commands/accounts/template/v6/package-lock.json +834 -0
  20. package/bin/v13/commands/accounts/template/v6/package.json +21 -0
  21. package/bin/v13/commands/accounts/template/v6/port.js +6 -0
  22. package/bin/v13/commands/accounts/template/v6/routes.js +5 -0
  23. package/bin/v13/commands/accounts/template/v6/server.js +13 -0
  24. package/bin/v13/commands/accounts/template/v7/.env +9 -0
  25. package/bin/v13/commands/accounts/template/v7/.env.local +7 -0
  26. package/bin/v13/commands/accounts/template/v7/.vscode/launch.json +12 -0
  27. package/bin/v13/commands/accounts/template/v7/Config/Schemas/journals.json +60 -0
  28. package/bin/v13/commands/accounts/template/v7/Config/api.json +8 -0
  29. package/bin/v13/commands/accounts/template/v7/Config/schema.json +8 -0
  30. package/bin/v13/commands/accounts/template/v7/Config/ui.json +8 -0
  31. package/bin/v13/commands/accounts/template/v7/Public/index.html +129 -0
  32. package/bin/v13/commands/accounts/template/v7/app.js +19 -0
  33. package/bin/v13/commands/accounts/template/v7/config.json +4 -0
  34. package/bin/v13/commands/accounts/template/v7/configLoader.js +6 -0
  35. package/bin/v13/commands/accounts/template/v7/package-lock.json +834 -0
  36. package/bin/v13/commands/accounts/template/v7/package.json +21 -0
  37. package/bin/v13/commands/accounts/template/v7/port.js +6 -0
  38. package/bin/v13/commands/accounts/template/v7/routes.js +5 -0
  39. package/bin/v13/commands/accounts/template/v7/server.js +13 -0
  40. package/bin/v13/commands/accounts.js +19 -0
  41. package/bin/v13/commands/express/steps/locateSource.js +1 -1
  42. package/bin/v13/commands/express/template/v6/.env +9 -0
  43. package/bin/v13/commands/express/template/v6/.env.local +7 -0
  44. package/bin/v13/commands/express/template/v6/.vscode/launch.json +12 -0
  45. package/bin/v13/commands/express/template/v6/Config/Schemas/BillsTable.json +165 -0
  46. package/bin/v13/commands/express/template/v6/Config/Schemas/ItemsTable.json +200 -0
  47. package/bin/v13/commands/express/template/v6/Config/Schemas/LedgerNames.json +60 -0
  48. package/bin/v13/commands/express/template/v6/Config/Schemas/StockItems.json +50 -0
  49. package/bin/v13/commands/express/template/v6/Config/api.json +8 -0
  50. package/bin/v13/commands/express/template/v6/Config/schema.json +8 -0
  51. package/bin/v13/commands/express/template/v6/Config/ui.json +8 -0
  52. package/bin/v13/commands/express/template/v6/Public/index.html +129 -0
  53. package/bin/v13/commands/express/template/v6/app.js +19 -0
  54. package/bin/v13/commands/express/template/v6/config.json +4 -0
  55. package/bin/v13/commands/express/template/v6/configLoader.js +6 -0
  56. package/bin/v13/commands/express/template/v6/package-lock.json +834 -0
  57. package/bin/v13/commands/express/template/v6/package.json +21 -0
  58. package/bin/v13/commands/express/template/v6/port.js +6 -0
  59. package/bin/v13/commands/express/template/v6/routes.js +5 -0
  60. package/bin/v13/commands/express/template/v6/server.js +13 -0
  61. package/bin/v13/core/resolveCommand.js +3 -1
  62. package/bin/v13/core/showUsage.js +2 -0
  63. package/index.js +2 -1
  64. package/package.json +1 -1
  65. package/bin/v13/core/showUsageV1.js +0 -42
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "KeshavSoft",
3
+ "version": "1.17.12",
4
+ "description": "",
5
+ "main": "app.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "start": "node --env-file=.env app.js"
10
+ },
11
+ "author": "",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "@keshavsoft/kschema": "^1.17.12",
15
+ "body-parser": "^2.2.0",
16
+ "express": "^5.1.0"
17
+ },
18
+ "devDependencies": {
19
+ "@keshavsoft/kschema-api-gen": "^1.6.4"
20
+ }
21
+ }
@@ -0,0 +1,6 @@
1
+ export default function normalizePort(val) {
2
+ const port = Number(val);
3
+ if (Number.isNaN(port)) return val;
4
+ if (port >= 0) return port;
5
+ return false;
6
+ };
@@ -0,0 +1,5 @@
1
+ import express from "express";
2
+
3
+ export default function setupRoutes(app) {
4
+ app.use(express.static('Public'));
5
+ };
@@ -0,0 +1,13 @@
1
+ import http from "http";
2
+ import normalizePort from "./port.js";
3
+
4
+ export default function startServer(app) {
5
+ const port = normalizePort(process.env.PORT || 3000);
6
+ const server = http.createServer(app);
7
+
8
+ server.listen(port, () => {
9
+ console.log(`http://localhost:${port}`);
10
+ });
11
+
12
+ return { port }; // 👈 add this
13
+ };
@@ -0,0 +1,9 @@
1
+ DataPath=Data
2
+ PORT=3000
3
+ VERSION= V3
4
+ TimeSpan=20
5
+ RepoType="GenWMailAndWs"
6
+ TablePath=Data/Ledgers.json
7
+ SchemaPath=Config/Schemas
8
+ KSSource=ConfigJson
9
+ OPEN_BROWSER=true
@@ -0,0 +1,7 @@
1
+ DataPath=Data
2
+ PORT=3000
3
+ VERSION= V3
4
+ TimeSpan=20
5
+ RepoType="GenWMailAndWs"
6
+ TablePath=Data/Ledgers.json
7
+ SchemaPath=Config/Schemas
@@ -0,0 +1,12 @@
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
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "tableName": "journals",
3
+ "columns": [
4
+ {
5
+ "field": "LedgerName",
6
+ "title": "LedgerName",
7
+ "unique": true,
8
+ "type": "text",
9
+ "isInput": true,
10
+ "isAutoFocus": true,
11
+ "defaultvalue": "KeshavSoft",
12
+ "isConsider": true
13
+ },
14
+ {
15
+ "field": "LedgerParentName",
16
+ "title": "LedgerParentName",
17
+ "type": "text",
18
+ "isInput": true,
19
+ "isConsider": true
20
+ },
21
+ {
22
+ "field": "LedgerType",
23
+ "title": "LedgerType",
24
+ "type": "text",
25
+ "isInput": true,
26
+ "isConsider": true
27
+ },
28
+ {
29
+ "field": "pk",
30
+ "title": "pk",
31
+ "primary": true
32
+ },
33
+ {
34
+ "field": "GstRegistrationType",
35
+ "title": "GstRegistrationType",
36
+ "isConsider": true
37
+ },
38
+ {
39
+ "field": "PartyGSTIN",
40
+ "title": "PartyGSTIN",
41
+ "isConsider": true
42
+ }
43
+ ],
44
+ "data": [],
45
+ "Vertical": [],
46
+ "DataTableOptions": {
47
+ "Header": {
48
+ "autoFocus": "LedgerName"
49
+ }
50
+ },
51
+ "NonSecured": {
52
+ "SubRoutes": [
53
+ "ShowAll",
54
+ "Insert",
55
+ "Pipe"
56
+ ]
57
+ },
58
+ "PrimarykeyTableNames": [],
59
+ "PrimarykeyTables": []
60
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "Tables": [
3
+ "BillsTable",
4
+ "ItemsTable",
5
+ "LedgerNames",
6
+ "StockItems"
7
+ ]
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "Tables": [
3
+ "BillsTable",
4
+ "ItemsTable",
5
+ "LedgerNames",
6
+ "StockItems"
7
+ ]
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "Tables": [
3
+ "BillsTable",
4
+ "ItemsTable",
5
+ "LedgerNames",
6
+ "StockItems"
7
+ ]
8
+ }
@@ -0,0 +1,129 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>KeshavSoft</title>
8
+
9
+ <style>
10
+ body {
11
+ margin: 0;
12
+ font-family: Arial, sans-serif;
13
+ background: #0f172a;
14
+ color: #e2e8f0;
15
+ }
16
+
17
+ header {
18
+ background: #1e293b;
19
+ padding: 20px;
20
+ text-align: center;
21
+ }
22
+
23
+ header h1 {
24
+ margin: 0;
25
+ color: #38bdf8;
26
+ }
27
+
28
+ header p {
29
+ margin: 5px 0 0;
30
+ color: #94a3b8;
31
+ }
32
+
33
+ .container {
34
+ padding: 40px 20px;
35
+ max-width: 900px;
36
+ margin: auto;
37
+ }
38
+
39
+ .card {
40
+ background: #1e293b;
41
+ padding: 20px;
42
+ margin-bottom: 20px;
43
+ border-radius: 10px;
44
+ transition: 0.3s;
45
+ }
46
+
47
+ .card:hover {
48
+ transform: translateY(-5px);
49
+ background: #334155;
50
+ }
51
+
52
+ a {
53
+ color: #38bdf8;
54
+ text-decoration: none;
55
+ }
56
+
57
+ a:hover {
58
+ text-decoration: underline;
59
+ }
60
+
61
+ footer {
62
+ text-align: center;
63
+ padding: 20px;
64
+ background: #1e293b;
65
+ color: #94a3b8;
66
+ }
67
+ </style>
68
+ </head>
69
+
70
+ <body>
71
+
72
+ <header>
73
+ <h1>KeshavSoft</h1>
74
+ <p>Building Practical Software Solutions</p>
75
+ </header>
76
+
77
+ <div class="container">
78
+
79
+ <div class="card">
80
+ <h2>🌐 Website</h2>
81
+ <p>
82
+ Visit our official website:
83
+ <br>
84
+ <a href="https://keshavsoft.com/" target="_blank">
85
+ https://keshavsoft.com/
86
+ </a>
87
+ </p>
88
+ </div>
89
+
90
+ <div class="card">
91
+ <h2>💻 GitHub</h2>
92
+ <p>
93
+ Explore our open-source projects:
94
+ <br>
95
+ <a href="https://github.com/keshavsoft" target="_blank">
96
+ https://github.com/keshavsoft
97
+ </a>
98
+ </p>
99
+ </div>
100
+
101
+ <div class="card">
102
+ <h2>📦 npm Packages</h2>
103
+ <p>
104
+ Check our published packages:
105
+ <br>
106
+ <a href="https://www.npmjs.com/~keshavsoft" target="_blank">
107
+ https://www.npmjs.com/~keshavsoft
108
+ </a>
109
+ </p>
110
+ </div>
111
+
112
+ <div class="card">
113
+ <h2>🚀 About</h2>
114
+ <p>
115
+ KeshavSoft focuses on building modular, scalable, and practical tools
116
+ for real-world applications. Our goal is to simplify development and
117
+ accelerate delivery.
118
+ </p>
119
+ </div>
120
+
121
+ </div>
122
+
123
+ <footer>
124
+ © 2026 KeshavSoft. All rights reserved.
125
+ </footer>
126
+
127
+ </body>
128
+
129
+ </html>
@@ -0,0 +1,19 @@
1
+ import { exec } from "child_process";
2
+
3
+ import express from "express";
4
+
5
+ import loadConfig from "./configLoader.js";
6
+ import setupRoutes from "./routes.js";
7
+ import startServer from "./server.js";
8
+
9
+ loadConfig();
10
+
11
+ const app = express()
12
+
13
+ setupRoutes(app);
14
+
15
+ const { port } = startServer(app);
16
+
17
+ if (process.env.OPEN_BROWSER === "true") {
18
+ exec(`start http://localhost:${port}`);
19
+ };
@@ -0,0 +1,4 @@
1
+ {
2
+ "DataPath": "Data",
3
+ "SchemaPath": "Config/Schemas"
4
+ }
@@ -0,0 +1,6 @@
1
+ import { kschema } from "@keshavsoft/kschema";
2
+ import configJson from './config.json' with { type: 'json' };
3
+
4
+ export default function loadConfig() {
5
+ kschema.loadConfig(configJson);
6
+ };