axiodb 22.9.7 → 22.11.0

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 (76) hide show
  1. package/README.md +43 -0
  2. package/lib/engine/cli/worker_process.d.ts +19 -0
  3. package/lib/engine/cli/worker_process.js +92 -0
  4. package/package.json +1 -1
  5. package/electron/electron-builder.json +0 -54
  6. package/electron/main/main.cts +0 -585
  7. package/electron/main/preload.cts +0 -51
  8. package/electron/package-lock.json +0 -8123
  9. package/electron/package.json +0 -56
  10. package/electron/public/AXioDB.png +0 -0
  11. package/electron/resources/after-install.sh +0 -45
  12. package/electron/resources/after-remove.sh +0 -29
  13. package/electron/resources/icon.png +0 -0
  14. package/electron/resources/icons/128x128.png +0 -0
  15. package/electron/resources/icons/16x16.png +0 -0
  16. package/electron/resources/icons/24x24.png +0 -0
  17. package/electron/resources/icons/256x256.png +0 -0
  18. package/electron/resources/icons/32x32.png +0 -0
  19. package/electron/resources/icons/48x48.png +0 -0
  20. package/electron/resources/icons/512x512.png +0 -0
  21. package/electron/resources/icons/64x64.png +0 -0
  22. package/electron/src/App.jsx +0 -128
  23. package/electron/src/api/authApi.js +0 -83
  24. package/electron/src/api/client.js +0 -102
  25. package/electron/src/assets/AXioDB.png +0 -0
  26. package/electron/src/components/auth/CreateRoleModal.jsx +0 -189
  27. package/electron/src/components/auth/CreateUserModal.jsx +0 -131
  28. package/electron/src/components/auth/ForcePasswordChangeModal.jsx +0 -132
  29. package/electron/src/components/auth/ProtectedRoute.jsx +0 -42
  30. package/electron/src/components/auth/ResetPasswordModal.jsx +0 -90
  31. package/electron/src/components/auth/UserAvatarMenu.jsx +0 -103
  32. package/electron/src/components/collection/CreateCollectionModal.jsx +0 -116
  33. package/electron/src/components/collection/DeleteCollectionModal.jsx +0 -85
  34. package/electron/src/components/collection/SchemaViewModal.jsx +0 -369
  35. package/electron/src/components/dashboard/CollectionsChart.jsx +0 -94
  36. package/electron/src/components/dashboard/DatabaseTreeView.jsx +0 -130
  37. package/electron/src/components/dashboard/InMemoryCacheCard.jsx +0 -60
  38. package/electron/src/components/dashboard/StorageDonut.jsx +0 -76
  39. package/electron/src/components/dashboard/StorageUsageCard.jsx +0 -59
  40. package/electron/src/components/dashboard/TotalCollectionsCard.jsx +0 -47
  41. package/electron/src/components/dashboard/TotalDatabasesCard.jsx +0 -43
  42. package/electron/src/components/dashboard/TotalDocumentsCard.jsx +0 -44
  43. package/electron/src/components/database/CreateDatabaseModal.jsx +0 -109
  44. package/electron/src/components/database/DeleteDatabaseModal.jsx +0 -97
  45. package/electron/src/components/query/CodeEditor.jsx +0 -343
  46. package/electron/src/components/query/ObjectEditor.jsx +0 -115
  47. package/electron/src/components/query/ObjectView.jsx +0 -44
  48. package/electron/src/components/query/QueryEditor.jsx +0 -32
  49. package/electron/src/components/query/queryLanguage.js +0 -755
  50. package/electron/src/components/ui/Button.jsx +0 -58
  51. package/electron/src/components/ui/Card.jsx +0 -29
  52. package/electron/src/components/ui/ErrorBoundary.jsx +0 -108
  53. package/electron/src/components/ui/Feedback.jsx +0 -66
  54. package/electron/src/components/ui/Field.jsx +0 -65
  55. package/electron/src/components/ui/MetricCard.jsx +0 -104
  56. package/electron/src/components/ui/Modal.jsx +0 -119
  57. package/electron/src/components/ui/Page.jsx +0 -40
  58. package/electron/src/config/key.js +0 -11
  59. package/electron/src/index.css +0 -181
  60. package/electron/src/index.html +0 -13
  61. package/electron/src/layout/Sidebar.jsx +0 -478
  62. package/electron/src/layout/StatusBar.jsx +0 -70
  63. package/electron/src/layout/Titlebar.jsx +0 -128
  64. package/electron/src/main.jsx +0 -42
  65. package/electron/src/pages/ConnectionHub.jsx +0 -464
  66. package/electron/src/pages/Dashboard.jsx +0 -128
  67. package/electron/src/pages/Documents.jsx +0 -823
  68. package/electron/src/pages/Import.jsx +0 -527
  69. package/electron/src/pages/UserManagement.jsx +0 -294
  70. package/electron/src/pages/Welcome.jsx +0 -157
  71. package/electron/src/store/authStore.js +0 -30
  72. package/electron/src/store/connectionStore.js +0 -103
  73. package/electron/src/store/dbStore.js +0 -165
  74. package/electron/src/store/store.js +0 -8
  75. package/electron/src/utils/format.js +0 -39
  76. package/electron/vite.config.js +0 -28
package/README.md CHANGED
@@ -55,11 +55,54 @@ console.log(data.documents);
55
55
 
56
56
  ## Installation
57
57
 
58
+ ### npm (Library)
59
+
58
60
  ```bash
59
61
  npm install axiodb
60
62
  # Node.js ≥20 (also verified on Bun v1.4.0)
61
63
  ```
62
64
 
65
+ ### CLI & Desktop GUI (System-wide)
66
+
67
+ AxioDB ships a CLI tool and a native Desktop GUI (Electron). The installer
68
+ presents a menu — **1) CLI**, **2) GUI**, **3) Both** — when run interactively,
69
+ and defaults to CLI when piped (`curl | bash`).
70
+
71
+ #### Quick Install (interactive)
72
+
73
+ ```bash
74
+ # Linux / macOS
75
+ curl -fsSL https://raw.githubusercontent.com/nexoral/AxioDB/main/cli/Scripts/install.sh | bash
76
+
77
+ # Windows (PowerShell)
78
+ irm https://raw.githubusercontent.com/nexoral/AxioDB/main/cli/Scripts/install.ps1 | iex
79
+ ```
80
+
81
+ #### Non-Interactive (choose what you want)
82
+
83
+ Set `CHOICE` before piping to select without the menu:
84
+
85
+ | `CHOICE` | Installs |
86
+ |----------|----------|
87
+ | `1` | CLI only |
88
+ | `2` | GUI (Desktop) only |
89
+ | `3` | CLI + GUI |
90
+
91
+ ```bash
92
+ # GUI (Desktop app) — Linux
93
+ curl -fsSL https://raw.githubusercontent.com/nexoral/AxioDB/main/cli/Scripts/install.sh | CHOICE=2 bash
94
+
95
+ # GUI (Desktop app) — Windows
96
+ irm https://raw.githubusercontent.com/nexoral/AxioDB/main/cli/Scripts/install.ps1 | CHOICE=2 iex
97
+
98
+ # Both CLI + GUI
99
+ curl -fsSL https://raw.githubusercontent.com/nexoral/AxioDB/main/cli/Scripts/install.sh | CHOICE=3 bash
100
+ ```
101
+
102
+ You can also download installers directly from
103
+ [GitHub Releases](https://github.com/nexoral/AxioDB/releases).
104
+
105
+
63
106
  ## Basic CRUD
64
107
 
65
108
  CRUD means **Create, Read, Update, and Delete**. The following example creates a database and
@@ -0,0 +1,19 @@
1
+ export default class WorkerProcess {
2
+ /**
3
+ * Executes a binary with explicit arguments without a shell, capturing stdout.
4
+ *
5
+ * No shell string is ever constructed, so filenames or paths containing shell
6
+ * metacharacters cannot inject extra commands. Always prefer this over building
7
+ * a shell command when arguments derive from user-controlled paths.
8
+ *
9
+ * @param command - The executable to run (e.g. "du", "wc", "powershell").
10
+ * @param args - Arguments passed verbatim; no quoting or interpolation is applied.
11
+ * @returns The command's captured stdout.
12
+ * @example
13
+ * const size = await worker.execCommandSafely("wc", ["-c", "--", targetPath]);
14
+ */
15
+ execCommandSafely(command: string, args?: string[]): Promise<string>;
16
+ /** Inherits stdio; rejects if the process exits with a non-zero code. */
17
+ spawnCommand(command: string, args?: string[]): Promise<void>;
18
+ static getOS(): string;
19
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const child_process_1 = require("child_process");
13
+ class WorkerProcess {
14
+ /**
15
+ * Executes a binary with explicit arguments without a shell, capturing stdout.
16
+ *
17
+ * No shell string is ever constructed, so filenames or paths containing shell
18
+ * metacharacters cannot inject extra commands. Always prefer this over building
19
+ * a shell command when arguments derive from user-controlled paths.
20
+ *
21
+ * @param command - The executable to run (e.g. "du", "wc", "powershell").
22
+ * @param args - Arguments passed verbatim; no quoting or interpolation is applied.
23
+ * @returns The command's captured stdout.
24
+ * @example
25
+ * const size = await worker.execCommandSafely("wc", ["-c", "--", targetPath]);
26
+ */
27
+ execCommandSafely(command_1) {
28
+ return __awaiter(this, arguments, void 0, function* (command, args = []) {
29
+ try {
30
+ const stdout = yield new Promise((resolve, reject) => {
31
+ const child = (0, child_process_1.spawn)(command, args, { shell: false });
32
+ let out = "";
33
+ let err = "";
34
+ child.stdout.on("data", (chunk) => {
35
+ out += chunk.toString();
36
+ });
37
+ child.stderr.on("data", (chunk) => {
38
+ err += chunk.toString();
39
+ });
40
+ child.on("error", reject);
41
+ child.on("close", (code) => {
42
+ if (code === 0) {
43
+ resolve(out);
44
+ }
45
+ else {
46
+ reject(new Error(`Command failed with exit code ${code}${err ? `: ${err.trim()}` : ""}`));
47
+ }
48
+ });
49
+ });
50
+ return stdout;
51
+ }
52
+ catch (error) {
53
+ throw new Error(`Failed to execute command: ${error}`);
54
+ }
55
+ });
56
+ }
57
+ /** Inherits stdio; rejects if the process exits with a non-zero code. */
58
+ spawnCommand(command_1) {
59
+ return __awaiter(this, arguments, void 0, function* (command, args = []) {
60
+ try {
61
+ const child = (0, child_process_1.spawn)(command, args, { stdio: "inherit" });
62
+ return new Promise((resolve, reject) => {
63
+ child.on("close", (code) => {
64
+ if (code !== 0) {
65
+ reject(new Error(`Command failed with exit code ${code}`));
66
+ }
67
+ else {
68
+ resolve();
69
+ }
70
+ });
71
+ });
72
+ }
73
+ catch (error) {
74
+ throw new Error(`Failed to spawn command: ${error}`);
75
+ }
76
+ });
77
+ }
78
+ static getOS() {
79
+ const platform = process.platform;
80
+ if (platform === "win32") {
81
+ return "windows";
82
+ }
83
+ if (platform === "darwin") {
84
+ return "macos";
85
+ }
86
+ if (platform === "linux") {
87
+ return "linux";
88
+ }
89
+ throw new Error(`Unsupported platform: ${platform}`);
90
+ }
91
+ }
92
+ exports.default = WorkerProcess;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axiodb",
3
- "version": "22.9.7",
3
+ "version": "22.11.0",
4
4
  "description": "The embedded database for Node.js. Replaces SQLite, LowDB, NeDB & raw JSON files with MongoDB-style queries, ACID transactions, zero native dependencies, and built-in InMemoryCache. No compilation, no platform issues. Perfect for desktop apps, CLI tools, and embedded systems.",
5
5
  "main": "./lib/config/DB.js",
6
6
  "types": "./lib/config/DB.d.ts",
@@ -1,54 +0,0 @@
1
- {
2
- "appId": "com.axiodb.control",
3
- "productName": "AxioDB Control",
4
- "copyright": "Copyright © 2026 Ankan Saha",
5
- "directories": {
6
- "output": "release",
7
- "buildResources": "resources"
8
- },
9
- "files": [
10
- "dist/**/*",
11
- "dist-electron/**/*",
12
- "resources/**/*",
13
- "package.json"
14
- ],
15
- "extraResources": [
16
- {
17
- "from": "resources/icon.png",
18
- "to": "icon.png"
19
- }
20
- ],
21
- "linux": {
22
- "target": [
23
- { "target": "deb", "arch": ["x64", "arm64"] },
24
- { "target": "AppImage", "arch": ["x64", "arm64"] }
25
- ],
26
- "maintainer": "Ankan Saha <dev@axiodb.in>",
27
- "category": "Development",
28
- "icon": "resources/icons",
29
- "synopsis": "Desktop GUI management client for AxioDB",
30
- "description": "Next-generation desktop interface for managing AxioDB databases, collections, documents, queries, and monitoring.",
31
- "desktop": {
32
- "StartupWMClass": "AxioDB Control"
33
- }
34
- },
35
- "win": {
36
- "target": [
37
- { "target": "nsis", "arch": ["x64"] }
38
- ],
39
- "icon": "resources/icon.png"
40
- },
41
- "mac": {
42
- "target": [
43
- { "target": "zip", "arch": ["x64", "arm64"] }
44
- ],
45
- "category": "public.app-category.developer-tools",
46
- "icon": "resources/icon.png"
47
- },
48
- "nsis": {
49
- "oneClick": false,
50
- "allowToChangeInstallationDirectory": true,
51
- "createDesktopShortcut": true,
52
- "createStartMenuShortcut": true
53
- }
54
- }