axiodb 2.19.66 → 2.21.66
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 +1 -1
- package/lib/Services/Indexation.operation.d.ts +16 -1
- package/lib/Services/Indexation.operation.js +22 -1
- package/lib/Services/Indexation.operation.js.map +1 -1
- package/lib/engine/Filesystem/FolderManager.js +2 -1
- package/lib/engine/Filesystem/FolderManager.js.map +1 -1
- package/lib/server/config/keys.d.ts +7 -1
- package/lib/server/config/keys.js +21 -2
- package/lib/server/config/keys.js.map +1 -1
- package/lib/server/config/server.js +1 -0
- package/lib/server/config/server.js.map +1 -1
- package/lib/server/controller/Database/Databse.controller.d.ts +52 -0
- package/lib/server/controller/Database/Databse.controller.js +119 -0
- package/lib/server/controller/Database/Databse.controller.js.map +1 -0
- package/lib/server/controller/Key/key.controller.d.ts +38 -0
- package/lib/server/controller/Key/key.controller.js +80 -0
- package/lib/server/controller/Key/key.controller.js.map +1 -0
- package/lib/server/public/AxioControl/.vite/manifest.json +2 -2
- package/lib/server/public/AxioControl/.vite/ssr-manifest.json +60 -1
- package/lib/server/public/AxioControl/assets/index-BEGb6b_2.css +1 -0
- package/lib/server/public/AxioControl/assets/index-b7mubB3g.js +56 -0
- package/lib/server/public/AxioControl/index.html +2 -2
- package/lib/server/public/AxioControl/sw.js +1 -1
- package/lib/server/router/Router.d.ts +6 -2
- package/lib/server/router/Router.js +26 -2
- package/lib/server/router/Router.js.map +1 -1
- package/lib/server/router/Routers/DB.routes.d.ts +7 -0
- package/lib/server/router/Routers/DB.routes.js +29 -0
- package/lib/server/router/Routers/DB.routes.js.map +1 -0
- package/package.json +1 -1
- package/lib/server/public/AxioControl/assets/index-CrwYZikH.css +0 -1
- package/lib/server/public/AxioControl/assets/index-HpIfPLrM.js +0 -51
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://badge.fury.io/js/axiodb)
|
|
4
4
|
[](https://github.com/AnkanSaha/AxioDB/actions/workflows/github-code-scanning/codeql)
|
|
5
5
|
[](https://socket.dev/npm/package/axiodb)
|
|
6
|
+
[](https://github.com/AnkanSaha/AxioDB/actions/workflows/Push.yml)
|
|
6
7
|
|
|
7
8
|
AxioDB is a blazing-fast, lightweight, and scalable open-source Database Management System (DBMS) tailored for modern applications. It supports `.axiodb` file-based data storage, offers intuitive APIs, and ensures secure data management. AxioDB is the ultimate solution for developers seeking efficient, flexible, and production-ready database solutions.
|
|
8
9
|
|
|
@@ -478,7 +479,6 @@ await collection1.delete({ age: { $lt: 25 } }).deleteMany();
|
|
|
478
479
|
|
|
479
480
|
- **`createCollection(name: string, schemaOrBoolean: object | boolean, schemaOrEmpty?: object, crypto?: boolean, key?: string): Promise<Collection>`**
|
|
480
481
|
Creates a collection with optional schema validation and encryption. The parameters are flexible:
|
|
481
|
-
|
|
482
482
|
- If the second parameter is a schema object, schema validation is enabled
|
|
483
483
|
- If the second parameter is a boolean, it determines whether schema validation is enabled
|
|
484
484
|
- For collections without schema but with encryption, pass `false, {}, true` as parameters
|
|
@@ -43,7 +43,22 @@ export declare class AxioDB {
|
|
|
43
43
|
*
|
|
44
44
|
* @returns {Promise<SuccessInterface | undefined>} A promise that resolves when the database information is successfully retrieved and the response is sent.
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
getInstanceInfo(): Promise<SuccessInterface | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* Checks if a database with the given name exists
|
|
49
|
+
*
|
|
50
|
+
* @param DBName - The name of the database to check for existence
|
|
51
|
+
* @returns A Promise that resolves to a boolean indicating whether the database exists
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const exists = await indexation.isDatabaseExists('myDatabase');
|
|
56
|
+
* if (exists) {
|
|
57
|
+
* console.log('Database exists');
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
isDatabaseExists(DBName: string): Promise<boolean>;
|
|
47
62
|
/**
|
|
48
63
|
* Deletes a database from the current directory.
|
|
49
64
|
*
|
|
@@ -103,7 +103,7 @@ class AxioDB {
|
|
|
103
103
|
*
|
|
104
104
|
* @returns {Promise<SuccessInterface | undefined>} A promise that resolves when the database information is successfully retrieved and the response is sent.
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
getInstanceInfo() {
|
|
107
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
108
|
const totalDatabases = yield this.folderManager.ListDirectory(path_1.default.resolve(this.currentPATH));
|
|
109
109
|
const totalSize = yield this.folderManager.GetDirectorySize(path_1.default.resolve(this.currentPATH));
|
|
@@ -125,6 +125,27 @@ class AxioDB {
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Checks if a database with the given name exists
|
|
130
|
+
*
|
|
131
|
+
* @param DBName - The name of the database to check for existence
|
|
132
|
+
* @returns A Promise that resolves to a boolean indicating whether the database exists
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* const exists = await indexation.isDatabaseExists('myDatabase');
|
|
137
|
+
* if (exists) {
|
|
138
|
+
* console.log('Database exists');
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
isDatabaseExists(DBName) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const dbPath = path_1.default.join(this.currentPATH, DBName);
|
|
145
|
+
const exists = yield this.folderManager.DirectoryExists(dbPath);
|
|
146
|
+
return exists.statusCode === outers_1.StatusCodes.OK;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
128
149
|
// Delete Database
|
|
129
150
|
/**
|
|
130
151
|
* Deletes a database from the current directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Indexation.operation.js","sourceRoot":"","sources":["../../source/Services/Indexation.operation.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;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,WAAW,EAAE,MAAM,CAAC,CAAC;YACnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAChE,OAAO,MAAM,CAAC,UAAU,KAAK,oBAAW,CAAC,EAAE,CAAC;QAC9C,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;AA/JD,wBA+JC"}
|
|
@@ -149,11 +149,12 @@ class FolderManager {
|
|
|
149
149
|
const size = parseInt(stdout, 10);
|
|
150
150
|
return this.responseHelper.Success(size);
|
|
151
151
|
}
|
|
152
|
-
const stdout = yield this.WorkerProcess.execCommand(`du -sb ${path}`);
|
|
152
|
+
const stdout = yield this.WorkerProcess.execCommand(`du -sb "${path}"`);
|
|
153
153
|
const size = parseInt(stdout.split("\t")[0], 10);
|
|
154
154
|
return this.responseHelper.Success(size);
|
|
155
155
|
}
|
|
156
156
|
catch (err) {
|
|
157
|
+
console.error(`Error getting directory size: ${err}`);
|
|
157
158
|
return this.responseHelper.Error(`Failed to get directory size: ${err}`);
|
|
158
159
|
}
|
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= "AxioDB Server",
|
|
6
|
+
DEFAULT_KEY_AUDIENCE = "AxioDB Client",
|
|
7
|
+
DEFAULT_KEY_REASON = "For Transacting with AxioDB Server",
|
|
8
|
+
DEFAULT_KEY_TIMESTAMP,
|
|
9
|
+
DEFAULT_KEY_ROUNDS = 1
|
|
4
10
|
}
|
|
5
11
|
export declare const CORS_CONFIG: {
|
|
6
12
|
ORIGIN: string;
|
|
@@ -9,6 +9,12 @@ var ServerKeys;
|
|
|
9
9
|
(function (ServerKeys) {
|
|
10
10
|
ServerKeys[ServerKeys["PORT"] = 27018] = "PORT";
|
|
11
11
|
ServerKeys["LOCALHOST"] = "127.0.1";
|
|
12
|
+
ServerKeys["DEFAULT_KEY_EXPIRE"] = "1h";
|
|
13
|
+
ServerKeys["DEFAULT_KEY_ISSUER"] = "AxioDB Server";
|
|
14
|
+
ServerKeys["DEFAULT_KEY_AUDIENCE"] = "AxioDB Client";
|
|
15
|
+
ServerKeys["DEFAULT_KEY_REASON"] = "For Transacting with AxioDB Server";
|
|
16
|
+
ServerKeys[ServerKeys["DEFAULT_KEY_TIMESTAMP"] = Date.now()] = "DEFAULT_KEY_TIMESTAMP";
|
|
17
|
+
ServerKeys[ServerKeys["DEFAULT_KEY_ROUNDS"] = 1] = "DEFAULT_KEY_ROUNDS";
|
|
12
18
|
})(ServerKeys || (exports.ServerKeys = ServerKeys = {}));
|
|
13
19
|
// Config for CORS
|
|
14
20
|
exports.CORS_CONFIG = {
|
|
@@ -39,16 +45,29 @@ exports.AvailableRoutes = [
|
|
|
39
45
|
},
|
|
40
46
|
{
|
|
41
47
|
method: "GET",
|
|
42
|
-
path: "/api/
|
|
48
|
+
path: "/api/get-token",
|
|
49
|
+
description: "Get a new token for transacting with AxioDB Server",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
method: "GET",
|
|
53
|
+
path: "/api/db/databases",
|
|
43
54
|
description: "Get a list of all databases",
|
|
44
55
|
},
|
|
45
56
|
{
|
|
46
57
|
method: "POST",
|
|
47
|
-
path: "/api/create-database",
|
|
58
|
+
path: "/api/db/create-database",
|
|
48
59
|
description: "Create a new database",
|
|
49
60
|
payload: {
|
|
50
61
|
name: "string",
|
|
51
62
|
},
|
|
52
63
|
},
|
|
64
|
+
{
|
|
65
|
+
method: "DELETE",
|
|
66
|
+
path: "/api/db/delete-database",
|
|
67
|
+
description: "Delete a database",
|
|
68
|
+
payload: {
|
|
69
|
+
name: "string",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
53
72
|
];
|
|
54
73
|
//# 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,UASX;AATD,WAAY,UAAU;IACpB,+CAAY,CAAA;IACZ,mCAAqB,CAAA;IACrB,uCAAyB,CAAA;IACzB,kDAAoC,CAAA;IACpC,oDAAsC,CAAA;IACtC,uEAAyD,CAAA;IACzD,iDAAwB,IAAI,CAAC,GAAG,EAAE,2BAAA,CAAA;IAClC,uEAAsB,CAAA;AACxB,CAAC,EATW,UAAU,0BAAV,UAAU,QASrB;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,WAAW;QACjB,WAAW,EAAE,4CAA4C;KAC1D;IACD;QACE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,+CAA+C;KAC7D;IACD;QACE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,+BAA+B;KAC7C;IACD;QACE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,oDAAoD;KAClE;IACD;QACE,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,6BAA6B;KAC3C;IACD;QACE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;SACf;KACF;IACD;QACE,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC"}
|
|
@@ -64,6 +64,7 @@ function createAxioDBControlServer(AxioDBInstance) {
|
|
|
64
64
|
// Register the main router with /api prefix
|
|
65
65
|
AxioDBControlServer.register(Router_1.default, {
|
|
66
66
|
prefix: "/api",
|
|
67
|
+
AxioDBInstance, // Pass the AxioDB instance to the router
|
|
67
68
|
});
|
|
68
69
|
try {
|
|
69
70
|
yield AxioDBControlServer.listen({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../source/server/config/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAWA,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../source/server/config/server.ts"],"names":[],"mappings":";;;;;;;;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+
import { FastifyRequest } from "fastify";
|
|
4
|
+
/**
|
|
5
|
+
* Controller class for managing databases in AxioDB.
|
|
6
|
+
*
|
|
7
|
+
* This class provides methods for retrieving database information,
|
|
8
|
+
* creating new databases, and other database management operations.
|
|
9
|
+
* It acts as an interface between the API routes and the AxioDB instance.
|
|
10
|
+
*/
|
|
11
|
+
export default class DatabaseController {
|
|
12
|
+
private AxioDBInstance;
|
|
13
|
+
constructor(AxioDBInstance: AxioDB);
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves a list of databases from the AxioDB instance.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<ResponseBuilder>} A Promise that resolves to a ResponseBuilder object
|
|
18
|
+
* containing the list of databases with an OK status code and a success message.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const response = await databaseController.getDatabases();
|
|
22
|
+
* // Returns a ResponseBuilder with status 200 and database list
|
|
23
|
+
*/
|
|
24
|
+
getDatabases(): Promise<ResponseBuilder>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new database with the specified name.
|
|
27
|
+
*
|
|
28
|
+
* @param request - The Fastify request object containing the database name in the body
|
|
29
|
+
* @returns A ResponseBuilder object containing the status and message of the operation
|
|
30
|
+
*
|
|
31
|
+
* @throws Will return a conflict response if database already exists
|
|
32
|
+
* @throws Will return a bad request response if name is missing, not a string, or empty
|
|
33
|
+
* @throws Will return an internal server error response if database creation fails
|
|
34
|
+
*/
|
|
35
|
+
createDatabase(request: FastifyRequest): Promise<ResponseBuilder>;
|
|
36
|
+
/**
|
|
37
|
+
* Deletes a database with the specified name.
|
|
38
|
+
*
|
|
39
|
+
* @param request - The Fastify request object containing the database name in the body
|
|
40
|
+
* @returns A ResponseBuilder object with appropriate status code and message
|
|
41
|
+
* - 200 OK if the database is successfully deleted
|
|
42
|
+
* - 404 NOT_FOUND if the database does not exist
|
|
43
|
+
* - 500 INTERNAL_SERVER_ERROR if an error occurs during deletion
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // Example request body
|
|
47
|
+
* {
|
|
48
|
+
* "name": "myDatabase"
|
|
49
|
+
* }
|
|
50
|
+
*/
|
|
51
|
+
deleteDatabase(request: FastifyRequest): Promise<ResponseBuilder>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
const outers_1 = require("outers");
|
|
16
|
+
const responseBuilder_helper_1 = __importDefault(require("../../helper/responseBuilder.helper"));
|
|
17
|
+
/**
|
|
18
|
+
* Controller class for managing databases in AxioDB.
|
|
19
|
+
*
|
|
20
|
+
* This class provides methods for retrieving database information,
|
|
21
|
+
* creating new databases, and other database management operations.
|
|
22
|
+
* It acts as an interface between the API routes and the AxioDB instance.
|
|
23
|
+
*/
|
|
24
|
+
class DatabaseController {
|
|
25
|
+
constructor(AxioDBInstance) {
|
|
26
|
+
this.AxioDBInstance = AxioDBInstance;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a list of databases from the AxioDB instance.
|
|
30
|
+
*
|
|
31
|
+
* @returns {Promise<ResponseBuilder>} A Promise that resolves to a ResponseBuilder object
|
|
32
|
+
* containing the list of databases with an OK status code and a success message.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* const response = await databaseController.getDatabases();
|
|
36
|
+
* // Returns a ResponseBuilder with status 200 and database list
|
|
37
|
+
*/
|
|
38
|
+
getDatabases() {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const databases = yield this.AxioDBInstance.getInstanceInfo();
|
|
41
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.OK, "List of Databases", databases === null || databases === void 0 ? void 0 : databases.data);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new database with the specified name.
|
|
46
|
+
*
|
|
47
|
+
* @param request - The Fastify request object containing the database name in the body
|
|
48
|
+
* @returns A ResponseBuilder object containing the status and message of the operation
|
|
49
|
+
*
|
|
50
|
+
* @throws Will return a conflict response if database already exists
|
|
51
|
+
* @throws Will return a bad request response if name is missing, not a string, or empty
|
|
52
|
+
* @throws Will return an internal server error response if database creation fails
|
|
53
|
+
*/
|
|
54
|
+
createDatabase(request) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const { name } = request.body;
|
|
57
|
+
try {
|
|
58
|
+
// check if the database already exists
|
|
59
|
+
const exists = yield this.AxioDBInstance.isDatabaseExists(name);
|
|
60
|
+
if (exists) {
|
|
61
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.CONFLICT, "Database already exists");
|
|
62
|
+
}
|
|
63
|
+
// create the database
|
|
64
|
+
if (!name) {
|
|
65
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.BAD_REQUEST, "Database name is required");
|
|
66
|
+
}
|
|
67
|
+
if (typeof name !== "string" || name.trim() === "") {
|
|
68
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.BAD_REQUEST, "Invalid database name");
|
|
69
|
+
}
|
|
70
|
+
yield this.AxioDBInstance.createDB(name);
|
|
71
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.CREATED, "Database Created", {
|
|
72
|
+
Database_Name: name,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error("Error creating database:", error);
|
|
77
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.INTERNAL_SERVER_ERROR, "Error creating database");
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Deletes a database with the specified name.
|
|
83
|
+
*
|
|
84
|
+
* @param request - The Fastify request object containing the database name in the body
|
|
85
|
+
* @returns A ResponseBuilder object with appropriate status code and message
|
|
86
|
+
* - 200 OK if the database is successfully deleted
|
|
87
|
+
* - 404 NOT_FOUND if the database does not exist
|
|
88
|
+
* - 500 INTERNAL_SERVER_ERROR if an error occurs during deletion
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // Example request body
|
|
92
|
+
* {
|
|
93
|
+
* "name": "myDatabase"
|
|
94
|
+
* }
|
|
95
|
+
*/
|
|
96
|
+
deleteDatabase(request) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const { dbName } = request.query;
|
|
99
|
+
try {
|
|
100
|
+
// check if the database exists
|
|
101
|
+
const exists = yield this.AxioDBInstance.isDatabaseExists(dbName);
|
|
102
|
+
if (!exists) {
|
|
103
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.NOT_FOUND, "Database not found");
|
|
104
|
+
}
|
|
105
|
+
// delete the database
|
|
106
|
+
yield this.AxioDBInstance.deleteDatabase(dbName);
|
|
107
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.OK, "Database Deleted", {
|
|
108
|
+
Database_Name: dbName,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.error("Error deleting database:", error);
|
|
113
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.INTERNAL_SERVER_ERROR, "Error deleting database");
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.default = DatabaseController;
|
|
119
|
+
//# sourceMappingURL=Databse.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Databse.controller.js","sourceRoot":"","sources":["../../../../source/server/controller/Database/Databse.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAAqC;AAErC,iGAE6C;AAG7C;;;;;;GAMG;AACH,MAAqB,kBAAkB;IAGrC,YAAY,cAAsB;QAChC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED;;;;;;;;;OASG;IACU,YAAY;;YACvB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC;YAC9D,OAAO,IAAA,gCAAa,EAAC,oBAAW,CAAC,EAAE,EAAE,mBAAmB,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,CAAC,CAAC;QAC7E,CAAC;KAAA;IAED;;;;;;;;;OASG;IACU,cAAc,CACzB,OAAuB;;YAEvB,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,IAAwB,CAAC;YAClD,IAAI,CAAC;gBACH,uCAAuC;gBACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBAChE,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,IAAA,gCAAa,EAAC,oBAAW,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAC;gBACxE,CAAC;gBACD,sBAAsB;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,IAAA,gCAAa,EAClB,oBAAW,CAAC,WAAW,EACvB,2BAA2B,CAC5B,CAAC;gBACJ,CAAC;gBAED,IAAI,OAAO,IAAI,KAAK,QAAQ,I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AAa,EAClB,oBAAW,CAAC,qBAAqB,EACjC,yBAAyB,CAC1B,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF;AAxGD,qCAwGC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controller class for handling key generation and verification operations.
|
|
3
|
+
*
|
|
4
|
+
* This class provides functionality for generating session keys using JWT (JSON Web Token)
|
|
5
|
+
* and verifying those keys for authentication purposes.
|
|
6
|
+
*
|
|
7
|
+
* @class KeyController
|
|
8
|
+
*/
|
|
9
|
+
export default class KeyController {
|
|
10
|
+
private readonly Generationkey;
|
|
11
|
+
constructor(Generationkey: string);
|
|
12
|
+
/**
|
|
13
|
+
* Generates a session key using JWT for authentication purposes.
|
|
14
|
+
*
|
|
15
|
+
* This method creates a new JWT token with default server key parameters
|
|
16
|
+
* including issuer, reason, audience, expiration time, and timestamp.
|
|
17
|
+
* The token is encrypted using the specified rounds of encryption.
|
|
18
|
+
*
|
|
19
|
+
* @returns {Promise<string | any>} A promise that resolves to a response object containing
|
|
20
|
+
* the generated session key or an error object in case of failure.
|
|
21
|
+
* The response includes status code, message, and the originSessionKey.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const keyController = new KeyController();
|
|
25
|
+
* const response = await keyController.generateKey();
|
|
26
|
+
* // response = { statusCode: 200, message: "Key Generated Successfully", data: { originSessionKey: "jwt-token" } }
|
|
27
|
+
*/
|
|
28
|
+
generateKey(): Promise<string | any>;
|
|
29
|
+
/**
|
|
30
|
+
* Verifies the provided API key.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} key - The API key to verify
|
|
33
|
+
* @returns {Promise<string | any>} A response object containing status code and message
|
|
34
|
+
* - If key is valid: Status 200 with success message
|
|
35
|
+
* - If key is invalid: Status 401 with error message
|
|
36
|
+
*/
|
|
37
|
+
verifyKey(key: string): Promise<string | any>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
16
|
+
const outers_1 = require("outers");
|
|
17
|
+
const responseBuilder_helper_1 = __importDefault(require("../../helper/responseBuilder.helper"));
|
|
18
|
+
const keys_1 = require("../../config/keys");
|
|
19
|
+
/**
|
|
20
|
+
* Controller class for handling key generation and verification operations.
|
|
21
|
+
*
|
|
22
|
+
* This class provides functionality for generating session keys using JWT (JSON Web Token)
|
|
23
|
+
* and verifying those keys for authentication purposes.
|
|
24
|
+
*
|
|
25
|
+
* @class KeyController
|
|
26
|
+
*/
|
|
27
|
+
class KeyController {
|
|
28
|
+
constructor(Generationkey) {
|
|
29
|
+
this.Generationkey = Generationkey;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generates a session key using JWT for authentication purposes.
|
|
33
|
+
*
|
|
34
|
+
* This method creates a new JWT token with default server key parameters
|
|
35
|
+
* including issuer, reason, audience, expiration time, and timestamp.
|
|
36
|
+
* The token is encrypted using the specified rounds of encryption.
|
|
37
|
+
*
|
|
38
|
+
* @returns {Promise<string | any>} A promise that resolves to a response object containing
|
|
39
|
+
* the generated session key or an error object in case of failure.
|
|
40
|
+
* The response includes status code, message, and the originSessionKey.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const keyController = new KeyController();
|
|
44
|
+
* const response = await keyController.generateKey();
|
|
45
|
+
* // response = { statusCode: 200, message: "Key Generated Successfully", data: { originSessionKey: "jwt-token" } }
|
|
46
|
+
*/
|
|
47
|
+
generateKey() {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const originSessionKey = new outers_1.ClassBased.JWT_Manager(this.Generationkey).generateLoginToken({
|
|
50
|
+
issuer: keys_1.ServerKeys.DEFAULT_KEY_ISSUER,
|
|
51
|
+
Reason: keys_1.ServerKeys.DEFAULT_KEY_REASON,
|
|
52
|
+
audience: keys_1.ServerKeys.DEFAULT_KEY_AUDIENCE,
|
|
53
|
+
expiringIn: keys_1.ServerKeys.DEFAULT_KEY_EXPIRE,
|
|
54
|
+
Timestamp: keys_1.ServerKeys.DEFAULT_KEY_TIMESTAMP,
|
|
55
|
+
}, keys_1.ServerKeys.DEFAULT_KEY_ROUNDS, keys_1.ServerKeys.DEFAULT_KEY_EXPIRE).toKen;
|
|
56
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.OK, "Key Generated Successfully", {
|
|
57
|
+
originSessionKey,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Verifies the provided API key.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} key - The API key to verify
|
|
65
|
+
* @returns {Promise<string | any>} A response object containing status code and message
|
|
66
|
+
* - If key is valid: Status 200 with success message
|
|
67
|
+
* - If key is invalid: Status 401 with error message
|
|
68
|
+
*/
|
|
69
|
+
verifyKey(key) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const isValid = new outers_1.ClassBased.JWT_Manager(this.Generationkey).decode(key);
|
|
72
|
+
if (!isValid || isValid.status == "Invalid") {
|
|
73
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.UNAUTHORIZED, "Invalid Key", null);
|
|
74
|
+
}
|
|
75
|
+
return (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.OK, "Key Verified Successfully", null);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.default = KeyController;
|
|
80
|
+
//# sourceMappingURL=key.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.controller.js","sourceRoot":"","sources":["../../../../source/server/controller/Key/key.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,mCAAiD;AACjD,iGAAgE;AAChE,4CAA+C;AAE/C;;;;;;;GAOG;AACH,MAAqB,aAAa;IAGhC,YAAY,aAAqB;QAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACU,WAAW;;YACtB,MAAM,gBAAgB,GAAG,IAAI,mBAAU,CAAC,WAAW,CACjD,IAAI,CAAC,aAAa,CACnB,CAAC,kBAAkB,CAClB;gBACE,MAAM,EAAE,iBAAU,CAAC,kBAAkB;gBACrC,MAAM,EAAE,iBAAU,CAAC,kBAAkB;gBACrC,QAAQ,EAAE,iBAAU,CAAC,oBAAoB;gBACzC,UAAU,EAAE,iBAAU,CAAC,kBAAkB;gBACzC,SAAS,EAAE,iBAAU,CAAC,qBAAqB;aAC5C,EACD,iBAAU,CAAC,kBAAkB,EAC7B,iBAAU,CAAC,kBAAkB,CAC9B,CAAC,KAAK,CAAC;YAER,OAAO,IAAA,gCAAa,EAAC,oBAAW,CAAC,EAAE,EAAE,4BAA4B,EAAE;gBACjE,gBAAgB;aACjB,CAAC,CAAC;QACL,CAAC;KAAA;IAED;;;;;;;OAOG;IACU,SAAS,CAAC,GAAW;;YAChC,MAAM,OAAO,GAAG,IAAI,mBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC3E,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;gBAC5C,OAAO,IAAA,gCAAa,EAAC,oBAAW,CAAC,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;YACtE,CAAC;YACD,OAAO,IAAA,gCAAa,EAAC,oBAAW,CAAC,EAAE,EAAE,2BAA2B,EAAE,IAAI,CAAC,CAAC;QAC1E,CAAC;KAAA;CACF;AA1DD,gCA0DC"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"\u0000/home/runner/work/AxioDB/AxioDB/GUI/node_modules/react/jsx-runtime.js?commonjs-module": [],
|
|
15
15
|
"\u0000/home/runner/work/AxioDB/AxioDB/GUI/node_modules/scheduler/cjs/scheduler.production.js?commonjs-exports": [],
|
|
16
16
|
"\u0000/home/runner/work/AxioDB/AxioDB/GUI/node_modules/scheduler/index.js?commonjs-module": [],
|
|
17
|
+
"\u0000commonjsHelpers.js": [],
|
|
17
18
|
"\u0000vite/modulepreload-polyfill.js": [],
|
|
18
19
|
"index.html": [],
|
|
19
20
|
"node_modules/@heroicons/react/outline/esm/ChipIcon.js": [],
|
|
@@ -24,6 +25,56 @@
|
|
|
24
25
|
"node_modules/@heroicons/react/outline/esm/ServerIcon.js": [],
|
|
25
26
|
"node_modules/@heroicons/react/solid/esm/ChevronDownIcon.js": [],
|
|
26
27
|
"node_modules/@heroicons/react/solid/esm/ChevronRightIcon.js": [],
|
|
28
|
+
"node_modules/axios/index.js": [],
|
|
29
|
+
"node_modules/axios/lib/adapters/adapters.js": [],
|
|
30
|
+
"node_modules/axios/lib/adapters/fetch.js": [],
|
|
31
|
+
"node_modules/axios/lib/adapters/xhr.js": [],
|
|
32
|
+
"node_modules/axios/lib/axios.js": [],
|
|
33
|
+
"node_modules/axios/lib/cancel/CancelToken.js": [],
|
|
34
|
+
"node_modules/axios/lib/cancel/CanceledError.js": [],
|
|
35
|
+
"node_modules/axios/lib/cancel/isCancel.js": [],
|
|
36
|
+
"node_modules/axios/lib/core/Axios.js": [],
|
|
37
|
+
"node_modules/axios/lib/core/AxiosError.js": [],
|
|
38
|
+
"node_modules/axios/lib/core/AxiosHeaders.js": [],
|
|
39
|
+
"node_modules/axios/lib/core/InterceptorManager.js": [],
|
|
40
|
+
"node_modules/axios/lib/core/buildFullPath.js": [],
|
|
41
|
+
"node_modules/axios/lib/core/dispatchRequest.js": [],
|
|
42
|
+
"node_modules/axios/lib/core/mergeConfig.js": [],
|
|
43
|
+
"node_modules/axios/lib/core/settle.js": [],
|
|
44
|
+
"node_modules/axios/lib/core/transformData.js": [],
|
|
45
|
+
"node_modules/axios/lib/defaults/index.js": [],
|
|
46
|
+
"node_modules/axios/lib/defaults/transitional.js": [],
|
|
47
|
+
"node_modules/axios/lib/env/data.js": [],
|
|
48
|
+
"node_modules/axios/lib/helpers/AxiosURLSearchParams.js": [],
|
|
49
|
+
"node_modules/axios/lib/helpers/HttpStatusCode.js": [],
|
|
50
|
+
"node_modules/axios/lib/helpers/bind.js": [],
|
|
51
|
+
"node_modules/axios/lib/helpers/buildURL.js": [],
|
|
52
|
+
"node_modules/axios/lib/helpers/combineURLs.js": [],
|
|
53
|
+
"node_modules/axios/lib/helpers/composeSignals.js": [],
|
|
54
|
+
"node_modules/axios/lib/helpers/cookies.js": [],
|
|
55
|
+
"node_modules/axios/lib/helpers/formDataToJSON.js": [],
|
|
56
|
+
"node_modules/axios/lib/helpers/isAbsoluteURL.js": [],
|
|
57
|
+
"node_modules/axios/lib/helpers/isAxiosError.js": [],
|
|
58
|
+
"node_modules/axios/lib/helpers/isURLSameOrigin.js": [],
|
|
59
|
+
"node_modules/axios/lib/helpers/null.js": [],
|
|
60
|
+
"node_modules/axios/lib/helpers/parseHeaders.js": [],
|
|
61
|
+
"node_modules/axios/lib/helpers/parseProtocol.js": [],
|
|
62
|
+
"node_modules/axios/lib/helpers/progressEventReducer.js": [],
|
|
63
|
+
"node_modules/axios/lib/helpers/resolveConfig.js": [],
|
|
64
|
+
"node_modules/axios/lib/helpers/speedometer.js": [],
|
|
65
|
+
"node_modules/axios/lib/helpers/spread.js": [],
|
|
66
|
+
"node_modules/axios/lib/helpers/throttle.js": [],
|
|
67
|
+
"node_modules/axios/lib/helpers/toFormData.js": [],
|
|
68
|
+
"node_modules/axios/lib/helpers/toURLEncodedForm.js": [],
|
|
69
|
+
"node_modules/axios/lib/helpers/trackStream.js": [],
|
|
70
|
+
"node_modules/axios/lib/helpers/validator.js": [],
|
|
71
|
+
"node_modules/axios/lib/platform/browser/classes/Blob.js": [],
|
|
72
|
+
"node_modules/axios/lib/platform/browser/classes/FormData.js": [],
|
|
73
|
+
"node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": [],
|
|
74
|
+
"node_modules/axios/lib/platform/browser/index.js": [],
|
|
75
|
+
"node_modules/axios/lib/platform/common/utils.js": [],
|
|
76
|
+
"node_modules/axios/lib/platform/index.js": [],
|
|
77
|
+
"node_modules/axios/lib/utils.js": [],
|
|
27
78
|
"node_modules/cookie/dist/index.js": [],
|
|
28
79
|
"node_modules/react-dom/cjs/react-dom-client.production.js": [],
|
|
29
80
|
"node_modules/react-dom/cjs/react-dom.production.js": [],
|
|
@@ -36,16 +87,24 @@
|
|
|
36
87
|
"node_modules/react/jsx-runtime.js": [],
|
|
37
88
|
"node_modules/scheduler/cjs/scheduler.production.js": [],
|
|
38
89
|
"node_modules/scheduler/index.js": [],
|
|
90
|
+
"node_modules/zustand/esm/react.mjs": [],
|
|
91
|
+
"node_modules/zustand/esm/vanilla.mjs": [],
|
|
39
92
|
"src/components/dashboard/DatabaseTreeView.jsx": [],
|
|
40
93
|
"src/components/dashboard/InMemoryCacheCard.jsx": [],
|
|
41
94
|
"src/components/dashboard/StorageUsageCard.jsx": [],
|
|
42
95
|
"src/components/dashboard/TotalCollectionsCard.jsx": [],
|
|
43
96
|
"src/components/dashboard/TotalDatabasesCard.jsx": [],
|
|
44
97
|
"src/components/dashboard/TotalDocumentsCard.jsx": [],
|
|
98
|
+
"src/components/database/CreateDatabaseModal.jsx": [],
|
|
99
|
+
"src/components/database/DatabaseList.jsx": [],
|
|
100
|
+
"src/components/database/DeleteDatabaseModal.jsx": [],
|
|
45
101
|
"src/config/config.jsx": [],
|
|
102
|
+
"src/config/key.js": [],
|
|
46
103
|
"src/index.css": [],
|
|
47
104
|
"src/layout/Footer.jsx": [],
|
|
48
105
|
"src/layout/Header.jsx": [],
|
|
49
106
|
"src/main.jsx": [],
|
|
50
|
-
"src/pages/Dashboard.jsx": []
|
|
107
|
+
"src/pages/Dashboard.jsx": [],
|
|
108
|
+
"src/pages/Databases.jsx": [],
|
|
109
|
+
"src/store/store.js": []
|
|
51
110
|
}
|