axiodb 17.0.0 → 18.1.3
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/README.md +8 -6
- package/cli/VERSION +1 -1
- package/cli/cmd/version.go +4 -17
- package/lib/Services/Indexation.operation.d.ts +3 -0
- package/lib/Services/Indexation.operation.js +32 -21
- package/lib/Services/Indexation.operation.js.map +1 -1
- package/lib/config/Interfaces/Operation/Indexation.operation.interface.d.ts +2 -0
- package/lib/server/config/server.d.ts +1 -1
- package/lib/server/config/server.js +22 -15
- package/lib/server/config/server.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -134,6 +134,7 @@ console.log(result.data.documents[0].message); // Hello, Developer! 👋
|
|
|
134
134
|
| Option | Type | Default | Description |
|
|
135
135
|
| --- | --- | --- | --- |
|
|
136
136
|
| `GUI` | `boolean` | `false` | Enable the web-based GUI dashboard at `localhost:27018` |
|
|
137
|
+
| `HTTP` | `boolean` | mirrors `GUI` | Enable the HTTP API server on port 27018 — auto-enables when GUI is on; `GUI: true` + `HTTP: false` throws an error |
|
|
137
138
|
| `RootName` | `string` | `"AxioDB"` | Name of the root folder database files are stored under |
|
|
138
139
|
| `CustomPath` | `string` | current working directory | Custom filesystem path for database storage |
|
|
139
140
|
| `TCP` | `boolean` | `false` | Enable the AxioDBCloud TCP server on port 27019 |
|
|
@@ -542,7 +543,7 @@ docker run -d \
|
|
|
542
543
|
--name axiodb-server \
|
|
543
544
|
-p 27018:27018 \
|
|
544
545
|
-p 27019:27019 \
|
|
545
|
-
-e
|
|
546
|
+
-e AXIODB_TCP_AUTH_ENABLED=true \
|
|
546
547
|
-v axiodb-data:/app \
|
|
547
548
|
theankansaha/axiodb
|
|
548
549
|
|
|
@@ -561,8 +562,9 @@ Every option below has a default matching the image's previous fixed behavior
|
|
|
561
562
|
| Variable | Default | Description |
|
|
562
563
|
| --- | --- | --- |
|
|
563
564
|
| `AXIODB_GUI` | `true` | Enable the HTTP Control Server / web GUI on port 27018 |
|
|
565
|
+
| `AXIODB_HTTP` | mirrors `AXIODB_GUI` | Enable the HTTP API server on port 27018 — auto-enables when GUI is on; `AXIODB_GUI=true` + `AXIODB_HTTP=false` is an error |
|
|
564
566
|
| `AXIODB_TCP` | `true` | Enable the AxioDBCloud TCP server on port 27019 |
|
|
565
|
-
| `
|
|
567
|
+
| `AXIODB_TCP_AUTH_ENABLED` | `true` | Require username/password authentication on TCP connections (same RBAC accounts as the GUI) |
|
|
566
568
|
| `AXIODB_TLS` | `false` | Encrypt TCP connections with TLS instead of plaintext (see [Advanced: TLS encryption](#advanced-tls-encryption)) |
|
|
567
569
|
| `AXIODB_TLS_CERT_PATH` | *(none)* | Path **inside the container** to a PEM cert file - required when `AXIODB_TLS=true`. Mount the real file in with `-v` first (see the TLS section above) |
|
|
568
570
|
| `AXIODB_TLS_KEY_PATH` | *(none)* | Path **inside the container** to the matching PEM private key - required when `AXIODB_TLS=true` |
|
|
@@ -579,7 +581,7 @@ docker run -d \
|
|
|
579
581
|
--name axiodb-server \
|
|
580
582
|
-p 27018:27018 \
|
|
581
583
|
-p 27019:27019 \
|
|
582
|
-
-e
|
|
584
|
+
-e AXIODB_TCP_AUTH_ENABLED=false \
|
|
583
585
|
-v axiodb-data:/app \
|
|
584
586
|
theankansaha/axiodb
|
|
585
587
|
```
|
|
@@ -598,7 +600,7 @@ services:
|
|
|
598
600
|
environment:
|
|
599
601
|
- AXIODB_GUI=true
|
|
600
602
|
- AXIODB_TCP=true
|
|
601
|
-
-
|
|
603
|
+
- AXIODB_TCP_AUTH_ENABLED=true
|
|
602
604
|
- AXIODB_ROOT_NAME=AxioDB
|
|
603
605
|
volumes:
|
|
604
606
|
- axiodb-data:/app
|
|
@@ -622,7 +624,7 @@ services:
|
|
|
622
624
|
environment:
|
|
623
625
|
- AXIODB_GUI=true
|
|
624
626
|
- AXIODB_TCP=true
|
|
625
|
-
-
|
|
627
|
+
- AXIODB_TCP_AUTH_ENABLED=true
|
|
626
628
|
- AXIODB_TLS=true
|
|
627
629
|
- AXIODB_TLS_CERT_PATH=/certs/cert.pem
|
|
628
630
|
- AXIODB_TLS_KEY_PATH=/certs/key.pem
|
|
@@ -678,7 +680,7 @@ that logged-in user's actual role, exactly like the HTTP Control Server. A View-
|
|
|
678
680
|
gets a real `403` on write tools; nothing is gated by a static container environment variable.
|
|
679
681
|
|
|
680
682
|
`AXIODB_MCP=true` only has RBAC to serve once it's actually seeded, which requires
|
|
681
|
-
`AXIODB_GUI=true` (the default) or `AXIODB_TCP=true` + `
|
|
683
|
+
`AXIODB_GUI=true` (the default) or `AXIODB_TCP=true` + `AXIODB_TCP_AUTH_ENABLED=true`.
|
|
682
684
|
|
|
683
685
|
Full tool catalogue, examples, and security notes: **[MCP Server docs](https://axiodb.in/mcp-server)**.
|
|
684
686
|
|
package/cli/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
18.1.3
|
package/cli/cmd/version.go
CHANGED
|
@@ -2,24 +2,22 @@ package cmd
|
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
4
|
"fmt"
|
|
5
|
-
"os"
|
|
6
|
-
"strings"
|
|
7
5
|
|
|
8
6
|
"github.com/spf13/cobra"
|
|
9
7
|
)
|
|
10
8
|
|
|
9
|
+
var cliVersion = "unknown"
|
|
10
|
+
|
|
11
11
|
var versionCmd = &cobra.Command{
|
|
12
12
|
Use: "version",
|
|
13
13
|
Short: "Print the CLI version",
|
|
14
14
|
Run: func(cmd *cobra.Command, args []string) {
|
|
15
15
|
short, _ := cmd.Flags().GetBool("short")
|
|
16
16
|
|
|
17
|
-
version := readVersion()
|
|
18
|
-
|
|
19
17
|
if short {
|
|
20
|
-
fmt.Println(
|
|
18
|
+
fmt.Println(cliVersion)
|
|
21
19
|
} else {
|
|
22
|
-
fmt.Printf("axiodb-cli version %s\n",
|
|
20
|
+
fmt.Printf("axiodb-cli version %s\n", cliVersion)
|
|
23
21
|
}
|
|
24
22
|
},
|
|
25
23
|
}
|
|
@@ -28,14 +26,3 @@ func init() {
|
|
|
28
26
|
versionCmd.Flags().Bool("short", false, "Print only the version number")
|
|
29
27
|
rootCmd.AddCommand(versionCmd)
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
func readVersion() string {
|
|
33
|
-
data, err := os.ReadFile("VERSION")
|
|
34
|
-
if err != nil {
|
|
35
|
-
data, err = os.ReadFile("../VERSION")
|
|
36
|
-
if err != nil {
|
|
37
|
-
return "unknown"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return strings.TrimSpace(string(data))
|
|
41
|
-
}
|
|
@@ -25,9 +25,12 @@ export declare class AxioDB {
|
|
|
25
25
|
private static _instance;
|
|
26
26
|
private DatabaseMap;
|
|
27
27
|
private GUI;
|
|
28
|
+
private HTTP;
|
|
28
29
|
private TCP;
|
|
29
30
|
private TCPAuth;
|
|
30
31
|
private TLS;
|
|
32
|
+
private ready;
|
|
33
|
+
private _initializing;
|
|
31
34
|
private TLSCertPath?;
|
|
32
35
|
private TLSKeyPath?;
|
|
33
36
|
constructor(options?: AxioDBOptions);
|
|
@@ -49,30 +49,30 @@ const LoginRateLimiter_service_1 = __importDefault(require("./Auth/LoginRateLimi
|
|
|
49
49
|
class AxioDB {
|
|
50
50
|
constructor(options = {}) {
|
|
51
51
|
this.GUI = Keys_1.General.DBMS_GUI_Enable;
|
|
52
|
+
this.HTTP = false;
|
|
52
53
|
this.TCP = false;
|
|
53
54
|
this.TCPAuth = false;
|
|
54
55
|
this.TLS = false;
|
|
56
|
+
this._initializing = false;
|
|
55
57
|
if (AxioDB._instance) {
|
|
56
58
|
throw new Error("Only one instance of AxioDB is allowed.");
|
|
57
59
|
}
|
|
58
60
|
AxioDB._instance = this;
|
|
59
61
|
const { GUI, RootName, CustomPath, TCP, TCPAuth, TLS, TLSCertPath, TLSKeyPath } = options;
|
|
60
|
-
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.TCP = TCP !== undefined ? TCP : false;
|
|
70
|
-
this.TCPAuth = TCPAuth !== undefined ? TCPAuth : false;
|
|
71
|
-
this.TLS = TLS !== undefined ? TLS : false;
|
|
62
|
+
this.RootName = RootName || Keys_1.General.DBMS_Name;
|
|
63
|
+
this.currentPATH = path_1.default.resolve(CustomPath || ".");
|
|
64
|
+
this.fileManager = new FileManager_1.default();
|
|
65
|
+
this.folderManager = new FolderManager_1.default();
|
|
66
|
+
this.Converter = new Converter_helper_1.default();
|
|
67
|
+
this.ResponseHelper = new response_helper_1.default();
|
|
68
|
+
this.DatabaseMap = new Map();
|
|
69
|
+
this.GUI = GUI !== undefined ? GUI : Keys_1.General.DBMS_GUI_Enable;
|
|
70
|
+
this.HTTP = options.HTTP !== undefined ? options.HTTP : (this.GUI ? true : false);
|
|
71
|
+
this.TCP = TCP !== undefined ? TCP : false;
|
|
72
|
+
this.TCPAuth = TCPAuth !== undefined ? TCPAuth : false;
|
|
73
|
+
this.TLS = TLS !== undefined ? TLS : false;
|
|
72
74
|
this.TLSCertPath = TLSCertPath;
|
|
73
75
|
this.TLSKeyPath = TLSKeyPath;
|
|
74
|
-
// Fail fast: never silently fall back to plaintext because a cert/key path was
|
|
75
|
-
// missing or unreadable - that would be a silent security downgrade.
|
|
76
76
|
if (this.TLS) {
|
|
77
77
|
if (!this.TLSCertPath || !this.TLSKeyPath) {
|
|
78
78
|
throw new Error("TLS: true requires both TLSCertPath and TLSKeyPath to be set.");
|
|
@@ -84,7 +84,11 @@ class AxioDB {
|
|
|
84
84
|
throw new Error(`TLSKeyPath does not exist: ${this.TLSKeyPath}`);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
this.
|
|
87
|
+
if (this.GUI && options.HTTP === false) {
|
|
88
|
+
throw new Error("GUI: true requires HTTP to be enabled. Set HTTP: true or remove the explicit HTTP: false.");
|
|
89
|
+
}
|
|
90
|
+
this._initializing = true;
|
|
91
|
+
this.ready = this.initializeRoot().finally(() => { this._initializing = false; });
|
|
88
92
|
}
|
|
89
93
|
/**
|
|
90
94
|
* Initializes the root directory for the AxioDB.
|
|
@@ -110,16 +114,15 @@ class AxioDB {
|
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
116
|
if (this.GUI || (this.TCP && this.TCPAuth)) {
|
|
113
|
-
yield new AuthSeeder_service_1.default(this).seedIfNeeded();
|
|
114
|
-
LoginRateLimiter_service_1.default.startCleanupSweep();
|
|
117
|
+
yield new AuthSeeder_service_1.default(this).seedIfNeeded();
|
|
118
|
+
LoginRateLimiter_service_1.default.startCleanupSweep();
|
|
115
119
|
}
|
|
116
|
-
if (this.
|
|
117
|
-
Console_helper_1.default.green("Starting AxioDB Control Server...");
|
|
118
|
-
(0, server_1.default)(this);
|
|
120
|
+
if (this.HTTP) {
|
|
121
|
+
Console_helper_1.default.green(this.GUI ? "Starting AxioDB Control Server..." : "Starting AxioDB HTTP API Server (API only, GUI disabled)...");
|
|
122
|
+
(0, server_1.default)(this, this.GUI);
|
|
119
123
|
}
|
|
120
124
|
if (this.TCP) {
|
|
121
125
|
Console_helper_1.default.green(this.TLS ? "Starting AxioDB TCP Server (TLS)..." : "Starting AxioDB TCP Server...");
|
|
122
|
-
// Start the TCP Server with the AxioDB instance
|
|
123
126
|
const tlsOptions = this.TLS
|
|
124
127
|
? { certPath: this.TLSCertPath, keyPath: this.TLSKeyPath }
|
|
125
128
|
: undefined;
|
|
@@ -143,6 +146,8 @@ class AxioDB {
|
|
|
143
146
|
*/
|
|
144
147
|
createDB(DBName) {
|
|
145
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
if (!this._initializing)
|
|
150
|
+
yield this.ready;
|
|
146
151
|
const dbPath = path_1.default.join(this.currentPATH, DBName);
|
|
147
152
|
// Check if the database already exists
|
|
148
153
|
const exists = yield this.folderManager.DirectoryExists(dbPath);
|
|
@@ -173,6 +178,8 @@ class AxioDB {
|
|
|
173
178
|
*/
|
|
174
179
|
getInstanceInfo() {
|
|
175
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
if (!this._initializing)
|
|
182
|
+
yield this.ready;
|
|
176
183
|
const totalDatabases = yield this.folderManager.ListDirectory(path_1.default.resolve(this.currentPATH));
|
|
177
184
|
// First
|
|
178
185
|
const totalSize = yield this.folderManager.GetDirectorySize(path_1.default.resolve(this.currentPATH));
|
|
@@ -212,6 +219,8 @@ class AxioDB {
|
|
|
212
219
|
*/
|
|
213
220
|
isDatabaseExists(DBName) {
|
|
214
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
if (!this._initializing)
|
|
223
|
+
yield this.ready;
|
|
215
224
|
const dbPath = path_1.default.join(this.currentPATH, DBName);
|
|
216
225
|
const exists = yield this.folderManager.DirectoryExists(dbPath);
|
|
217
226
|
return exists.statusCode === StatusCode_1.StatusCodes.OK;
|
|
@@ -231,6 +240,8 @@ class AxioDB {
|
|
|
231
240
|
*/
|
|
232
241
|
deleteDatabase(DBName) {
|
|
233
242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
243
|
+
if (!this._initializing)
|
|
244
|
+
yield this.ready;
|
|
234
245
|
const dbPath = path_1.default.join(this.currentPATH, DBName);
|
|
235
246
|
const exists = yield this.folderManager.DirectoryExists(dbPath);
|
|
236
247
|
if (exists.statusCode === StatusCode_1.StatusCodes.OK) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Indexation.operation.js","sourceRoot":"","sources":["../../source/Services/Indexation.operation.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;;;AAEvD,mBAAmB;AACnB,mFAA2D;AAC3D,uFAA+D;AAC/D,8CAA8C;AAC9C,gDAAwB;AACxB,4CAAoB;AACpB,uFAAqD;AACrD,kDAAkD;AAElD,iBAAiB;AACjB,kFAAmD;AACnD,8EAA+C;AAC/C,0DAAwD;AACxD,gFAAuD;AAQvD,qEAAgE;AAEhE,kEAAyD;AACzD,mFAAmD;AACnD,4DAA8D;AAC9D,+FAA+D;AAE/D;;;;;;;;;;;;;GAaG;AACH;
|
|
1
|
+
{"version":3,"file":"Indexation.operation.js","sourceRoot":"","sources":["../../source/Services/Indexation.operation.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;;;AAEvD,mBAAmB;AACnB,mFAA2D;AAC3D,uFAA+D;AAC/D,8CAA8C;AAC9C,gDAAwB;AACxB,4CAAoB;AACpB,uFAAqD;AACrD,kDAAkD;AAElD,iBAAiB;AACjB,kFAAmD;AACnD,8EAA+C;AAC/C,0DAAwD;AACxD,gFAAuD;AAQvD,qEAAgE;AAEhE,kEAAyD;AACzD,mFAAmD;AACnD,4DAA8D;AAC9D,+FAA+D;AAE/D;;;;;;;;;;;;;GAaG;AACH;IAmBE,YAAY,OAAO,GAAkB,EAAE;QAV/B,QAAG,GAAY,cAAO,CAAC,eAAe,CAAC;QACvC,SAAI,GAAY,KAAK,CAAC;QACtB,QAAG,GAAY,KAAK,CAAC;QACrB,YAAO,GAAY,KAAK,CAAC;QACzB,QAAG,GAAY,KAAK,CAAC;QAErB,kBAAa,GAAG,KAAK,CAAC;QAK5B,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;QAExB,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;QAE1F,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,cAAO,CAAC,SAAS,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,IAAI,qBAAW,EAA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Aa;gBAAE,MAAM,IAAI,CAAC,KAAK,CAAC;YAC1C,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YACnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAEhE,IAAI,MAAM,CAAC,UAAU,KAAK,wBAAW,CAAC,EAAE,EAAE,CAAC;gBACzC,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;gBACjD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,0BAA0B;gBAC3D,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAChC,aAAa,MAAM,uBAAuB,CAC3C,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,aAAa,MAAM,iBAAiB,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;KAAA;CACF"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DatabaseMap } from "./database.operation.interface";
|
|
2
2
|
export interface AxioDBOptions {
|
|
3
3
|
GUI?: boolean;
|
|
4
|
+
/** Enable HTTP API server on port 27018. Auto-enables when GUI: true. If GUI: true and HTTP: false, throws error at startup. */
|
|
5
|
+
HTTP?: boolean;
|
|
4
6
|
RootName?: string;
|
|
5
7
|
CustomPath?: string;
|
|
6
8
|
TCP?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AxioDB } from "../../Services/Indexation.operation";
|
|
2
|
-
export default function createAxioDBControlServer(AxioDBInstance: AxioDB): Promise<void>;
|
|
2
|
+
export default function createAxioDBControlServer(AxioDBInstance: AxioDB, guiEnabled?: boolean): Promise<void>;
|
|
@@ -24,8 +24,8 @@ const keys_1 = require("./keys");
|
|
|
24
24
|
const PortFreeChecker_1 = __importDefault(require("./PortFreeChecker"));
|
|
25
25
|
const Router_1 = __importDefault(require("../router/Router"));
|
|
26
26
|
const SessionStore_service_1 = __importDefault(require("../../Services/Auth/SessionStore.service"));
|
|
27
|
-
function createAxioDBControlServer(
|
|
28
|
-
return __awaiter(this,
|
|
27
|
+
function createAxioDBControlServer(AxioDBInstance_1) {
|
|
28
|
+
return __awaiter(this, arguments, void 0, function* (AxioDBInstance, guiEnabled = true) {
|
|
29
29
|
yield (0, PortFreeChecker_1.default)(keys_1.ServerKeys.PORT);
|
|
30
30
|
const AxioDBControlServer = (0, fastify_1.default)({
|
|
31
31
|
logger: false,
|
|
@@ -52,19 +52,26 @@ function createAxioDBControlServer(AxioDBInstance) {
|
|
|
52
52
|
done(err, undefined);
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
if (guiEnabled) {
|
|
56
|
+
yield AxioDBControlServer.register(static_1.default, {
|
|
57
|
+
root: keys_1.staticPath,
|
|
58
|
+
prefix: "/",
|
|
59
|
+
decorateReply: false,
|
|
60
|
+
});
|
|
61
|
+
AxioDBControlServer.get("/", (request, reply) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const indexPath = path_1.default.join(keys_1.staticPath, "index.html");
|
|
63
|
+
const stream = fs_1.default.createReadStream(indexPath);
|
|
64
|
+
return reply.type("text/html").send(stream);
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
AxioDBControlServer.get("/", (request, reply) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
return reply.type("application/json").send({
|
|
70
|
+
message: "AxioDB HTTP API is running. GUI is disabled. Enable it with GUI: true.",
|
|
71
|
+
api: "/api/health",
|
|
72
|
+
});
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
68
75
|
AxioDBControlServer.register(Router_1.default, {
|
|
69
76
|
prefix: "/api",
|
|
70
77
|
AxioDBInstance,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../source/server/config/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,sDAA8B;AAC9B,yDAAwC;AACxC,6DAA4C;AAC5C,6DAA4C;AAC5C,gDAAwB;AACxB,4CAAoB;AACpB,iCAA6D;AAC7D,wEAAmD;AAEnD,8DAAsC;AACtC,oGAAoE;AAEpE,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../source/server/config/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,sDAA8B;AAC9B,yDAAwC;AACxC,6DAA4C;AAC5C,6DAA4C;AAC5C,gDAAwB;AACxB,4CAAoB;AACpB,iCAA6D;AAC7D,wEAAmD;AAEnD,8DAAsC;AACtC,oGAAoE;AAEpE;yDACE,cAAsB,EACtB,UAAU,GAAY,IAAI;QAE1B,MAAM,IAAA,yBAAkB,EAAC,iBAAU,CAAC,IAAI,CAAC,CAAC;QAE1C,MAAM,mBAAmB,GAAG,IAAA,iBAAO,EAAC;YAClC,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,QAAQ,EAAE,OAAO;SAC7B,CAAC,CAAC;QAEH,MAAM,mBAAmB,CAAC,QAAQ,CAAC,cAAW,EAAE;YAC9C,MAAM,EAAE,kBAAW,CAAC,MAAM;YAC1B,OAAO,EAAE,kBAAW,CAAC,OAAO;YAC5B,cAAc,EAAE,kBAAW,CAAC,eAAe;YAC3C,WAAW,EAAE,kBAAW,CAAC,iBAAiB;YAC1C,cAAc,EAAE,kBAAW,CAAC,eAAe;YAC3C,MAAM,EAAE,kBAAW,CAAC,OAAO,EAAE,2BAA2B;SACzD,CAAC,CAAC;QAEH,8EAA8E;QAC9E,kFAAkF;QAClF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AC,CAAC;YACL,CAAC,CAAA,CAAC,CAAC;QACL,CAAC;QAED,mBAAmB,CAAC,QAAQ,CAAC,gBAAM,EAAE;YACnC,MAAM,EAAE,MAAM;YACd,cAAc;SACf,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,mBAAmB,CAAC,MAAM,CAAC;gBAC/B,IAAI,EAAE,MAAM,CAAC,iBAAU,CAAC,IAAI,CAAC;gBAC7B,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;YACH,8BAAY,CAAC,iBAAiB,EAAE,CAAC;YACjC,OAAO,CAAC,GAAG,CACT,wDAAwD,iBAAU,CAAC,IAAI,EAAE,CAC1E,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axiodb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.1.3",
|
|
4
4
|
"description": "The Pure JavaScript Alternative to SQLite. Embedded NoSQL database for Node.js with MongoDB-style queries, zero native dependencies, built-in InMemoryCache, and web GUI. Perfect for desktop apps, CLI tools, and embedded systems. No compilation, no platform issues—pure JavaScript from npm install to production.",
|
|
5
5
|
"main": "./lib/config/DB.js",
|
|
6
6
|
"types": "./lib/config/DB.d.ts",
|