axiodb 2.13.50 → 2.13.52
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/lib/Operation/Indexation.operation.d.ts +1 -0
- package/lib/Operation/Indexation.operation.js +6 -1
- package/lib/Operation/Indexation.operation.js.map +1 -1
- package/lib/config/DB.js +0 -2
- package/lib/config/DB.js.map +1 -1
- package/lib/server/config/PortFreeChecker.d.ts +51 -0
- package/lib/server/config/PortFreeChecker.js +112 -0
- package/lib/server/config/PortFreeChecker.js.map +1 -0
- package/lib/server/config/keys.d.ts +23 -1
- package/lib/server/config/keys.js +37 -1
- package/lib/server/config/keys.js.map +1 -1
- package/lib/server/config/server.d.ts +2 -1
- package/lib/server/config/server.js +16 -9
- package/lib/server/config/server.js.map +1 -1
- package/lib/server/helper/responseBuilder.helper.d.ts +17 -0
- package/lib/server/helper/responseBuilder.helper.js +28 -0
- package/lib/server/helper/responseBuilder.helper.js.map +1 -0
- package/lib/server/public/AxioControl/index.html +23 -2
- package/lib/server/public/AxioControl/sw.js +1 -1
- package/lib/server/router/Router.d.ts +9 -0
- package/lib/server/router/Router.js +47 -0
- package/lib/server/router/Router.js.map +1 -0
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ const database_operation_1 = __importDefault(require("./Database/database.operat
|
|
|
25
25
|
const Converter_helper_1 = __importDefault(require("../Helper/Converter.helper"));
|
|
26
26
|
const outers_1 = require("outers");
|
|
27
27
|
const response_helper_1 = __importDefault(require("../Helper/response.helper"));
|
|
28
|
+
const server_1 = __importDefault(require("../server/config/server"));
|
|
28
29
|
/**
|
|
29
30
|
* Class representing the AxioDB database.
|
|
30
31
|
* @param {string} RootName - The name of the root folder.
|
|
@@ -32,6 +33,10 @@ const response_helper_1 = __importDefault(require("../Helper/response.helper"));
|
|
|
32
33
|
*/
|
|
33
34
|
class AxioDB {
|
|
34
35
|
constructor(RootName, CustomPath) {
|
|
36
|
+
if (AxioDB._instance) {
|
|
37
|
+
throw new Error("Only one instance of AxioDB is allowed.");
|
|
38
|
+
}
|
|
39
|
+
AxioDB._instance = this;
|
|
35
40
|
this.RootName = RootName || Keys_1.General.DBMS_Name; // Set the root name
|
|
36
41
|
this.currentPATH = path_1.default.resolve(CustomPath || "."); // Set the current path
|
|
37
42
|
this.fileManager = new FileManager_1.default(); // Initialize the FileManager class
|
|
@@ -63,7 +68,7 @@ class AxioDB {
|
|
|
63
68
|
console.log(`AxioDB folder created at: ${this.currentPATH}`);
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
|
-
|
|
71
|
+
(0, server_1.default)(this); // Start the web Control Server with the AxioDB instance
|
|
67
72
|
});
|
|
68
73
|
}
|
|
69
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Indexation.operation.js","sourceRoot":"","sources":["../../source/Operation/Indexation.operation.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;;;AAEvD,mBAAmB;AACnB,yEAAiD;AACjD,6EAAqD;AACrD,8CAA8C;AAC9C,gDAAwB;AACxB,uFAAqD;AACrD,kDAAkD;AAElD,iBAAiB;AACjB,kFAAmD;AACnD,mCAAqC;AACrC,gFAAuD;
|
|
1
|
+
{"version":3,"file":"Indexation.operation.js","sourceRoot":"","sources":["../../source/Operation/Indexation.operation.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;;;AAEvD,mBAAmB;AACnB,yEAAiD;AACjD,6EAAqD;AACrD,8CAA8C;AAC9C,gDAAwB;AACxB,uFAAqD;AACrD,kDAAkD;AAElD,iBAAiB;AACjB,kFAAmD;AACnD,mCAAqC;AACrC,gFAAuD;AAQvD,qEAAgE;AAEhE;;;;GAIG;AACH,MAAa,MAAM;IASjB,YAAY,QAAiB,EAAE,UAAmB;QAChD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,CAAC,SA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Ac,CAAC,IAAI;oBACpC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,EAAE,CACxD,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAChC;iBACF,CAAC;gBACF,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;KAAA;IAED,kBAAkB;IAClB;;;;;;;;;;OAUG;IACU,cAAc,CACzB,MAAc;;YAEd,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,oBAAW,CAAC,EAAE,EAAE,CAAC;gBACzC,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;gBACjD,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;AAzID,wBAyIC"}
|
package/lib/config/DB.js
CHANGED
|
@@ -18,7 +18,6 @@ const collection_operation_1 = __importDefault(require("../Operation/Collection/
|
|
|
18
18
|
const database_operation_1 = __importDefault(require("../Operation/Database/database.operation"));
|
|
19
19
|
const Indexation_operation_1 = require("../Operation/Indexation.operation");
|
|
20
20
|
Object.defineProperty(exports, "AxioDB", { enumerable: true, get: function () { return Indexation_operation_1.AxioDB; } });
|
|
21
|
-
const server_1 = __importDefault(require("../server/config/server"));
|
|
22
21
|
const FileManager_1 = __importDefault(require("../Storage/FileManager"));
|
|
23
22
|
const FolderManager_1 = __importDefault(require("../Storage/FolderManager"));
|
|
24
23
|
// Export All Required Sub Modules Instance Types to support TypeScript
|
|
@@ -34,7 +33,6 @@ const InstanceTypes = {
|
|
|
34
33
|
InMemoryCache: cache_operation_1.InMemoryCache,
|
|
35
34
|
};
|
|
36
35
|
exports.InstanceTypes = InstanceTypes;
|
|
37
|
-
(0, server_1.default)();
|
|
38
36
|
// Export With All Sub Modules
|
|
39
37
|
exports.default = {
|
|
40
38
|
SchemaTypes: DataTypes_models_1.SchemaTypes,
|
package/lib/config/DB.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DB.js","sourceRoot":"","sources":["../../source/config/DB.ts"],"names":[],"mappings":";;;;;;AAAA,kCAAkC;AAClC,gEAA2D;AAC3D,kFAAmD;AACnD,2DAAuD;AACvD,gFAAuD;AACvD,iEAAyD;
|
|
1
|
+
{"version":3,"file":"DB.js","sourceRoot":"","sources":["../../source/config/DB.ts"],"names":[],"mappings":";;;;;;AAAA,kCAAkC;AAClC,gEAA2D;AAC3D,kFAAmD;AACnD,2DAAuD;AACvD,gFAAuD;AACvD,iEAAyD;AAsBhD,4FAtBA,8BAAW,OAsBA;AArBpB,kFAAwD;AAqBlC,yBArBf,0BAAc,CAqBe;AApBpC,2GAAyE;AACzE,wGAAsE;AACtE,kGAAgE;AAChE,4EAA2D;AAiBrB,uFAjB7B,6BAAM,OAiB6B;AAhB5C,yEAAiD;AACjD,6EAAqD;AAErD,uEAAuE;AACvE,MAAM,aAAa,GAAG;IACpB,UAAU,EAAV,8BAAU;IACV,QAAQ,EAAR,4BAAQ;IACR,WAAW,EAAX,+BAAW;IACX,WAAW,EAAX,qBAAW;IACX,aAAa,EAAb,uBAAa;IACb,SAAS,EAAT,0BAAS;IACT,YAAY,EAAZ,4BAAY;IACZ,cAAc,EAAd,yBAAc;IACd,aAAa,EAAb,+BAAa;CACd,CAAC;AAE4C,sCAAa;AAE3D,8BAA8B;AAC9B,kBAAe;IACb,WAAW,EAAX,8BAAW;IACX,cAAc,EAAd,0BAAc;IACd,MAAM,EAAN,6BAAM;IACN,aAAa;CACd,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ServerKeys } from "./keys";
|
|
2
|
+
/**
|
|
3
|
+
* Checks whether a specific port is already in use.
|
|
4
|
+
*
|
|
5
|
+
* @param port - The port number to check
|
|
6
|
+
* @param host - The host to check the port on, defaults to localhost
|
|
7
|
+
* @returns A Promise that resolves to true if the port is in use, false otherwise
|
|
8
|
+
* @throws {Error} If the port is already in use
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Check if port 3000 is available
|
|
12
|
+
* try {
|
|
13
|
+
* const inUse = await isPortInUse(3000);
|
|
14
|
+
* if (!inUse) {
|
|
15
|
+
* // Port is free, can use it
|
|
16
|
+
* }
|
|
17
|
+
* } catch (error) {
|
|
18
|
+
* console.error(error.message);
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export declare function isPortInUse(port: number, host?: ServerKeys): Promise<unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Checks if a specified port is currently mapped to any running Docker container.
|
|
24
|
+
*
|
|
25
|
+
* This function executes a Docker command to list all running containers and their port mappings,
|
|
26
|
+
* then filters for containers that are using the specified port.
|
|
27
|
+
*
|
|
28
|
+
* @param port - The port number to check for Docker container mappings
|
|
29
|
+
* @throws {Error} If the specified port is already mapped to a Docker container
|
|
30
|
+
* @returns {Promise<void>}
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* try {
|
|
35
|
+
* await checkDockerPortMapping(3000);
|
|
36
|
+
* // Port 3000 is free for use
|
|
37
|
+
* } catch (error) {
|
|
38
|
+
* // Port 3000 is already in use by a Docker container
|
|
39
|
+
* console.error(error.message);
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function checkDockerPortMapping(port: number): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Checks if a specified port is in use and if there's a Docker port mapping for that port.
|
|
46
|
+
*
|
|
47
|
+
* @param port - The port number to check
|
|
48
|
+
* @returns A Promise that resolves when both port usage check and Docker port mapping check are complete
|
|
49
|
+
* @throws May throw an error if the port is already in use or if there's a conflict with Docker port mappings
|
|
50
|
+
*/
|
|
51
|
+
export default function checkPortAndDocker(port: number): Promise<void>;
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.isPortInUse = isPortInUse;
|
|
16
|
+
exports.checkDockerPortMapping = checkDockerPortMapping;
|
|
17
|
+
exports.default = checkPortAndDocker;
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
19
|
+
const net_1 = __importDefault(require("net"));
|
|
20
|
+
const child_process_1 = require("child_process");
|
|
21
|
+
const keys_1 = require("./keys");
|
|
22
|
+
/**
|
|
23
|
+
* Checks whether a specific port is already in use.
|
|
24
|
+
*
|
|
25
|
+
* @param port - The port number to check
|
|
26
|
+
* @param host - The host to check the port on, defaults to localhost
|
|
27
|
+
* @returns A Promise that resolves to true if the port is in use, false otherwise
|
|
28
|
+
* @throws {Error} If the port is already in use
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Check if port 3000 is available
|
|
32
|
+
* try {
|
|
33
|
+
* const inUse = await isPortInUse(3000);
|
|
34
|
+
* if (!inUse) {
|
|
35
|
+
* // Port is free, can use it
|
|
36
|
+
* }
|
|
37
|
+
* } catch (error) {
|
|
38
|
+
* console.error(error.message);
|
|
39
|
+
* }
|
|
40
|
+
*/
|
|
41
|
+
function isPortInUse(port, host = keys_1.ServerKeys.LOCALHOST) {
|
|
42
|
+
return new Promise((resolve) => {
|
|
43
|
+
const server = net_1.default
|
|
44
|
+
.createServer()
|
|
45
|
+
.once("error", (err) => {
|
|
46
|
+
if (err.code === "EADDRINUSE") {
|
|
47
|
+
resolve(true); // Port is in use
|
|
48
|
+
throw new Error(`Port ${port} is already in use. Please Free the port to get the GUI.`);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
resolve(false); // Other error
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
.once("listening", () => {
|
|
55
|
+
server.close();
|
|
56
|
+
resolve(false); // Port is free
|
|
57
|
+
})
|
|
58
|
+
.listen(port, String(host));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Checks if a specified port is currently mapped to any running Docker container.
|
|
63
|
+
*
|
|
64
|
+
* This function executes a Docker command to list all running containers and their port mappings,
|
|
65
|
+
* then filters for containers that are using the specified port.
|
|
66
|
+
*
|
|
67
|
+
* @param port - The port number to check for Docker container mappings
|
|
68
|
+
* @throws {Error} If the specified port is already mapped to a Docker container
|
|
69
|
+
* @returns {Promise<void>}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* try {
|
|
74
|
+
* await checkDockerPortMapping(3000);
|
|
75
|
+
* // Port 3000 is free for use
|
|
76
|
+
* } catch (error) {
|
|
77
|
+
* // Port 3000 is already in use by a Docker container
|
|
78
|
+
* console.error(error.message);
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
function checkDockerPortMapping(port) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
(0, child_process_1.exec)(`docker ps --format "{{.ID}} {{.Ports}}"`, (error, stdout, _stderr) => {
|
|
85
|
+
if (error) {
|
|
86
|
+
console.error(`Error executing docker: ${error.message}`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const containers = stdout.trim().split("\n");
|
|
90
|
+
const matching = containers.filter((line) => line.includes(`:${port}->`));
|
|
91
|
+
if (matching.length > 0) {
|
|
92
|
+
console.log(`Docker container(s) found using port ${port}:`);
|
|
93
|
+
matching.forEach((c) => console.log(c));
|
|
94
|
+
throw new Error(`Port ${port} is already mapped to a Docker container. Please stop the container or Please Free the port to get the GUI.`);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Checks if a specified port is in use and if there's a Docker port mapping for that port.
|
|
101
|
+
*
|
|
102
|
+
* @param port - The port number to check
|
|
103
|
+
* @returns A Promise that resolves when both port usage check and Docker port mapping check are complete
|
|
104
|
+
* @throws May throw an error if the port is already in use or if there's a conflict with Docker port mappings
|
|
105
|
+
*/
|
|
106
|
+
function checkPortAndDocker(port) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
yield isPortInUse(port);
|
|
109
|
+
yield checkDockerPortMapping(port);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=PortFreeChecker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PortFreeChecker.js","sourceRoot":"","sources":["../../../source/server/config/PortFree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AAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7C,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC;YAE1E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,wCAAwC,IAAI,GAAG,CAAC,CAAC;gBAC7D,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxC,MAAM,IAAI,KAAK,CACb,QAAQ,IAAI,6GAA6G,CAC1H,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAED;;;;;;GAMG;AACH,SAA8B,kBAAkB,CAAC,IAAY;;QAC3D,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;QACxB,MAAM,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CAAA"}
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
export declare enum ServerKeys {
|
|
2
|
-
PORT = 27018
|
|
2
|
+
PORT = 27018,
|
|
3
|
+
LOCALHOST = "127.0.1"
|
|
3
4
|
}
|
|
5
|
+
export declare const CORS_CONFIG: {
|
|
6
|
+
ORIGIN: string;
|
|
7
|
+
METHODS: string[];
|
|
8
|
+
ALLOWED_HEADERS: string[];
|
|
9
|
+
EXPOSED_HEADERS: string[];
|
|
10
|
+
MAX_AGE: number;
|
|
11
|
+
ALLOW_CREDENTIALS: boolean;
|
|
12
|
+
};
|
|
4
13
|
export declare const staticPath: string;
|
|
14
|
+
export declare const AvailableRoutes: ({
|
|
15
|
+
method: string;
|
|
16
|
+
path: string;
|
|
17
|
+
description: string;
|
|
18
|
+
payload?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
method: string;
|
|
21
|
+
path: string;
|
|
22
|
+
description: string;
|
|
23
|
+
payload: {
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
})[];
|
|
@@ -3,11 +3,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.staticPath = exports.ServerKeys = void 0;
|
|
6
|
+
exports.AvailableRoutes = exports.staticPath = exports.CORS_CONFIG = exports.ServerKeys = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
var ServerKeys;
|
|
9
9
|
(function (ServerKeys) {
|
|
10
10
|
ServerKeys[ServerKeys["PORT"] = 27018] = "PORT";
|
|
11
|
+
ServerKeys["LOCALHOST"] = "127.0.1";
|
|
11
12
|
})(ServerKeys || (exports.ServerKeys = ServerKeys = {}));
|
|
13
|
+
// Config for CORS
|
|
14
|
+
exports.CORS_CONFIG = {
|
|
15
|
+
ORIGIN: "*",
|
|
16
|
+
METHODS: ["GET", "HEAD", "PUT", "PATCH", "POST", "DELETE"],
|
|
17
|
+
ALLOWED_HEADERS: ["Content-Type", "Authorization"],
|
|
18
|
+
EXPOSED_HEADERS: ["Content-Length", "X-Requested-With"],
|
|
19
|
+
MAX_AGE: 86400, // 24 hours in seconds
|
|
20
|
+
ALLOW_CREDENTIALS: true,
|
|
21
|
+
};
|
|
12
22
|
exports.staticPath = path_1.default.resolve(__dirname, "../public/AxioControl");
|
|
23
|
+
// Routes
|
|
24
|
+
exports.AvailableRoutes = [
|
|
25
|
+
{
|
|
26
|
+
method: "GET",
|
|
27
|
+
path: "/health",
|
|
28
|
+
description: "Health check endpoint to verify server status",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: "/routes",
|
|
33
|
+
description: "List all available API routes",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
method: "GET",
|
|
37
|
+
path: "/api/databases",
|
|
38
|
+
description: "Get a list of all databases",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
method: "POST",
|
|
42
|
+
path: "/api/create-database",
|
|
43
|
+
description: "Create a new database",
|
|
44
|
+
payload: {
|
|
45
|
+
name: "string",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
13
49
|
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../source/server/config/keys.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,IAAY,
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../source/server/config/keys.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,+CAAY,CAAA;IACZ,mCAAqB,CAAA;AACvB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,kBAAkB;AACL,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC;IAC1D,eAAe,EAAE,CAAC,cAAc,EAAE,eAAe,CAAC;IAClD,eAAe,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;IACvD,OAAO,EAAE,KAAK,EAAE,sBAAsB;IACtC,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEW,QAAA,UAAU,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;AAE3E,SAAS;AAEI,QAAA,eAAe,GAAG;IAC7B;QACE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,+CAA+C;KAC7D;IACD;QACE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,+BAA+B;KAC7C;IACD;QACE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,6BAA6B;KAC3C;IACD;QACE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { AxioDB } from "../../Operation/Indexation.operation";
|
|
2
|
+
export default function createAxioDBControlServer(AxioDBInstance: AxioDB): Promise<void>;
|
|
@@ -13,14 +13,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.default = createAxioDBControlServer;
|
|
16
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
16
17
|
const fastify_1 = __importDefault(require("fastify"));
|
|
17
18
|
const cors_1 = __importDefault(require("@fastify/cors"));
|
|
18
19
|
const static_1 = __importDefault(require("@fastify/static"));
|
|
19
20
|
const path_1 = __importDefault(require("path"));
|
|
20
21
|
const fs_1 = __importDefault(require("fs"));
|
|
21
22
|
const keys_1 = require("./keys");
|
|
22
|
-
|
|
23
|
+
const PortFreeChecker_1 = __importDefault(require("./PortFreeChecker"));
|
|
24
|
+
const Router_1 = __importDefault(require("../router/Router"));
|
|
25
|
+
function createAxioDBControlServer(AxioDBInstance) {
|
|
23
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield (0, PortFreeChecker_1.default)(keys_1.ServerKeys.PORT);
|
|
24
28
|
const AxioDBControlServer = (0, fastify_1.default)({
|
|
25
29
|
logger: false, // Disable default logging
|
|
26
30
|
trustProxy: true, // Trust the reverse proxy headers
|
|
@@ -28,12 +32,12 @@ function createAxioDBControlServer() {
|
|
|
28
32
|
});
|
|
29
33
|
// Attach Middlewares
|
|
30
34
|
yield AxioDBControlServer.register(cors_1.default, {
|
|
31
|
-
origin:
|
|
32
|
-
methods:
|
|
33
|
-
allowedHeaders:
|
|
34
|
-
credentials:
|
|
35
|
-
exposedHeaders:
|
|
36
|
-
maxAge:
|
|
35
|
+
origin: keys_1.CORS_CONFIG.ORIGIN, // Allow all origins
|
|
36
|
+
methods: keys_1.CORS_CONFIG.METHODS, // Allow specific methods
|
|
37
|
+
allowedHeaders: keys_1.CORS_CONFIG.ALLOWED_HEADERS, // Allow specific headers
|
|
38
|
+
credentials: keys_1.CORS_CONFIG.ALLOW_CREDENTIALS, // Allow credentials
|
|
39
|
+
exposedHeaders: keys_1.CORS_CONFIG.EXPOSED_HEADERS, // Expose specific headers
|
|
40
|
+
maxAge: keys_1.CORS_CONFIG.MAX_AGE, // Cache preflight response for 24 hours
|
|
37
41
|
});
|
|
38
42
|
// Configure JSON parsing
|
|
39
43
|
AxioDBControlServer.addContentTypeParser("application/json", { parseAs: "string", bodyLimit: 52428800 }, (req, body, done) => {
|
|
@@ -45,7 +49,6 @@ function createAxioDBControlServer() {
|
|
|
45
49
|
done(err, undefined);
|
|
46
50
|
}
|
|
47
51
|
});
|
|
48
|
-
// Link React build output
|
|
49
52
|
// Serve static files first (JS, CSS, images)
|
|
50
53
|
yield AxioDBControlServer.register(static_1.default, {
|
|
51
54
|
root: keys_1.staticPath,
|
|
@@ -58,9 +61,13 @@ function createAxioDBControlServer() {
|
|
|
58
61
|
const stream = fs_1.default.createReadStream(indexPath);
|
|
59
62
|
return reply.type("text/html").send(stream);
|
|
60
63
|
}));
|
|
64
|
+
// Register the main router with /api prefix
|
|
65
|
+
AxioDBControlServer.register(Router_1.default, {
|
|
66
|
+
prefix: "/api",
|
|
67
|
+
});
|
|
61
68
|
try {
|
|
62
69
|
yield AxioDBControlServer.listen({
|
|
63
|
-
port: keys_1.ServerKeys.PORT,
|
|
70
|
+
port: Number(keys_1.ServerKeys.PORT),
|
|
64
71
|
host: "0.0.0.0",
|
|
65
72
|
});
|
|
66
73
|
console.log(`AxioDB Control Server is running on http://localhost:${keys_1.ServerKeys.PORT}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../source/server/config/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../source/server/config/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAWA,4CAkEC;AA7ED,sDAAsD;AACtD,sDAA8B;AAC9B,yDAAwC;AACxC,6DAA4C;AAC5C,gDAAwB;AACxB,4CAAoB;AACpB,iCAA6D;AAC7D,wEAAmD;AAEnD,8DAAsC;AAEtC,SAA8B,yBAAyB,CACrD,cAAsB;;QAEtB,MAAM,IAAA,yBAAkB,EAAC,iBAAU,CAAC,IAAI,CAAC,CAAC;QAE1C,MAAM,mBAAmB,GAAG,IAAA,iBAAO,EAAC;YAClC,MAAM,EAAE,KAAK,EAAE,0BAA0B;YACzC,UAAU,EAAE,IAAI,EAAE,kCAAkC;YACpD,SAAS,EAAE,QAAQ,EAAE,yBAAyB;SAC/C,CAAC,CAAC;QAEH,qBAAqB;QACrB,MAAM,mBAAmB,CAAC,QAAQ,CAAC,cAAW,EAAE;YAC9C,MAAM,EAAE,kBAAW,CAAC,MAAM,EAAE,oBAAoB;YAChD,OAAO,EAAE,kBAAW,CAAC,OAAO,EAAE,yBAAyB;YACvD,cAAc,EAAE,kBAAW,CAAC,eAAe,EAAE,yBAAyB;YACtE,WAAW,EAAE,kBAAW,CAAC,iBAAiB,EAAE,oBAAoB;YAChE,cAAc,EAAE,kBAAW,CAAC,eAAe,EAAE,0BAA0B;YACvE,MAAM,EAAE,kBAAW,CAAC,OAAO,EAAE,wCAAwC;SACtE,CAAC,CAAC;QAEH,yBAAyB;QACzB,mBAAmB,CAAC,oBAAoB,CACtC,kBAAkB,EAClB,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,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G,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a standardized response object with status code, message, and optional data.
|
|
3
|
+
*
|
|
4
|
+
* @param statusCode - The HTTP status code to include in the response
|
|
5
|
+
* @param message - The message describing the result of the operation
|
|
6
|
+
* @param data - Optional data payload to include in the response
|
|
7
|
+
* @returns A response object with statusCode, message, and data properties
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Success response with data
|
|
11
|
+
* buildResponse(200, "User fetched successfully", { id: 1, name: "John Doe" });
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Error response without data
|
|
15
|
+
* buildResponse(404, "User not found");
|
|
16
|
+
*/
|
|
17
|
+
export default function buildResponse(statusCode: number, message: string, data?: any): object;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = buildResponse;
|
|
5
|
+
/**
|
|
6
|
+
* Builds a standardized response object with status code, message, and optional data.
|
|
7
|
+
*
|
|
8
|
+
* @param statusCode - The HTTP status code to include in the response
|
|
9
|
+
* @param message - The message describing the result of the operation
|
|
10
|
+
* @param data - Optional data payload to include in the response
|
|
11
|
+
* @returns A response object with statusCode, message, and data properties
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Success response with data
|
|
15
|
+
* buildResponse(200, "User fetched successfully", { id: 1, name: "John Doe" });
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Error response without data
|
|
19
|
+
* buildResponse(404, "User not found");
|
|
20
|
+
*/
|
|
21
|
+
function buildResponse(statusCode, message, data) {
|
|
22
|
+
return {
|
|
23
|
+
statusCode,
|
|
24
|
+
message,
|
|
25
|
+
data: data || null,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=responseBuilder.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responseBuilder.helper.js","sourceRoot":"","sources":["../../../source/server/helper/responseBuilder.helper.ts"],"names":[],"mappings":";AAAA,uDAAuD;;AAkBvD,gCAUC;AA1BD;;;;;;;;;;;;;;;GAeG;AACH,SAAwB,aAAa,CACnC,UAAkB,EAClB,OAAe,EACf,IAAU;IAEV,OAAO;QACL,UAAU;QACV,OAAO;QACP,IAAI,EAAE,IAAI,IAAI,IAAI;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -2,12 +2,33 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/AxioDB.png" />
|
|
6
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>
|
|
6
|
+
<title>AxioDB - Database Management System</title>
|
|
7
|
+
<meta
|
|
8
|
+
name="description"
|
|
9
|
+
content="AxioDB - A powerful, efficient database management system with an intuitive web-based GUI."
|
|
10
|
+
/>
|
|
11
|
+
<meta
|
|
12
|
+
name="keywords"
|
|
13
|
+
content="AxioDB, database, DBMS, SQL, NoSQL, data management, web GUI"
|
|
14
|
+
/>
|
|
15
|
+
<meta name="author" content="AxioDB" />
|
|
16
|
+
<meta name="robots" content="index, follow" />
|
|
17
|
+
<meta property="og:title" content="AxioDB - Database Management System" />
|
|
18
|
+
<meta
|
|
19
|
+
property="og:description"
|
|
20
|
+
content="Powerful database management system with an intuitive web interface."
|
|
21
|
+
/>
|
|
22
|
+
<meta property="og:image" content="AXioDB.png" />
|
|
23
|
+
<meta property="og:url" content="https://axiodb.site" />
|
|
24
|
+
<meta property="og:type" content="website" />
|
|
25
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
26
|
+
<link rel="canonical" href="https://axiodb.site" />
|
|
27
|
+
<link rel="icon" type="image/svg+xml" href="AXioDB.png" />
|
|
8
28
|
<script type="module" crossorigin src="/assets/index-DHz4mTIK.js"></script>
|
|
9
29
|
<link rel="stylesheet" crossorigin href="/assets/index-D8b4DHJx.css">
|
|
10
30
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
31
|
+
|
|
11
32
|
<body>
|
|
12
33
|
<div id="root"></div>
|
|
13
34
|
</body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const
|
|
1
|
+
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const c=e=>i(e,t),l={module:{uri:t},exports:o,require:c};s[t]=Promise.all(n.map(e=>l[e]||c(e))).then(e=>(r(...e),o))}}define(["./workbox-5ffe50d4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-D8b4DHJx.css",revision:null},{url:"assets/index-DHz4mTIK.js",revision:null},{url:"index.html",revision:"ac581326b6c629ae8982926c67f7cbf4"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"531c27931688c6a365595ec1badc959b"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FastifyInstance, FastifyPluginOptions } from "fastify";
|
|
2
|
+
/**
|
|
3
|
+
* Main router plugin for the AxioDB server
|
|
4
|
+
*
|
|
5
|
+
* @param fastify - Fastify instance
|
|
6
|
+
* @param _options - Plugin options
|
|
7
|
+
* @param done - Callback to signal completion
|
|
8
|
+
*/
|
|
9
|
+
export default function mainRouter(fastify: FastifyInstance, _options: FastifyPluginOptions, done: () => void): Promise<void>;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.default = mainRouter;
|
|
16
|
+
const keys_1 = require("../config/keys");
|
|
17
|
+
const responseBuilder_helper_1 = __importDefault(require("../helper/responseBuilder.helper"));
|
|
18
|
+
const outers_1 = require("outers");
|
|
19
|
+
/**
|
|
20
|
+
* Main router plugin for the AxioDB server
|
|
21
|
+
*
|
|
22
|
+
* @param fastify - Fastify instance
|
|
23
|
+
* @param _options - Plugin options
|
|
24
|
+
* @param done - Callback to signal completion
|
|
25
|
+
*/
|
|
26
|
+
function mainRouter(fastify, _options, done) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
// Health check route
|
|
29
|
+
fastify.get("/health", () => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return { status: "ok", timestamp: new Date().toISOString() };
|
|
31
|
+
}));
|
|
32
|
+
// Available routes List
|
|
33
|
+
fastify.get("/routes", (request, reply) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return reply
|
|
35
|
+
.status(200)
|
|
36
|
+
.send((0, responseBuilder_helper_1.default)(outers_1.StatusCodes.OK, "Available routes", keys_1.AvailableRoutes));
|
|
37
|
+
}));
|
|
38
|
+
// Handle 404 Not Found
|
|
39
|
+
fastify.setNotFoundHandler((request, reply) => {
|
|
40
|
+
reply
|
|
41
|
+
.status(404)
|
|
42
|
+
.send((0, responseBuilder_helper_1.default)(outers_1.StatusCodes.NOT_FOUND, `Route ${request.method}:${request.url} not found`));
|
|
43
|
+
});
|
|
44
|
+
done();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=Router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../source/server/router/Router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,6BA8BC;AAzCD,yCAAiD;AACjD,8FAA6D;AAC7D,mCAAqC;AAErC;;;;;;GAMG;AACH,SAA8B,UAAU,CACtC,OAAwB,EACxB,QAA8B,EAC9B,IAAgB;;QAEhB,qBAAqB;QACrB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,GAAS,EAAE;YAChC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;QAC/D,CAAC,CAAA,CAAC,CAAC;QAEH,wBAAwB;QACxB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAO,OAAO,EAAE,KAAK,EAAE,EAAE;YAC9C,OAAO,KAAK;iBACT,MAAM,CAAC,GAAG,CAAC;iBACX,IAAI,CAAC,IAAA,gCAAa,EAAC,oBAAW,CAAC,EAAE,EAAE,kBAAkB,EAAE,sBAAe,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAA,CAAC,CAAC;QAEH,uBAAuB;QACvB,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAC5C,KAAK;iBACF,MAAM,CAAC,GAAG,CAAC;iBACX,IAAI,CACH,IAAA,gCAAa,EACX,oBAAW,CAAC,SAAS,EACrB,SAAS,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,YAAY,CACnD,CACF,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,IAAI,EAAE,CAAC;IACT,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axiodb",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.52",
|
|
4
4
|
"description": "A blazing-fast, lightweight, and scalable nodejs package based DBMS for modern application. Supports schemas, encryption, and advanced query capabilities.",
|
|
5
5
|
"main": "./lib/config/DB.js",
|
|
6
6
|
"types": "./lib/config/DB.d.ts",
|