axiodb 2.19.65 → 2.20.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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/lib/Services/CRUD Operation/Delete.operation.js +1 -1
  3. package/lib/Services/CRUD Operation/Delete.operation.js.map +1 -1
  4. package/lib/Services/CRUD Operation/Reader.operation.js +1 -1
  5. package/lib/Services/CRUD Operation/Reader.operation.js.map +1 -1
  6. package/lib/Services/CRUD Operation/Update.operation.js +1 -1
  7. package/lib/Services/CRUD Operation/Update.operation.js.map +1 -1
  8. package/lib/Services/Indexation.operation.d.ts +16 -1
  9. package/lib/Services/Indexation.operation.js +22 -1
  10. package/lib/Services/Indexation.operation.js.map +1 -1
  11. package/lib/caching/cache.operation.d.ts +64 -0
  12. package/lib/caching/cache.operation.js +175 -0
  13. package/lib/caching/cache.operation.js.map +1 -0
  14. package/lib/config/DB.d.ts +1 -1
  15. package/lib/config/DB.js +1 -1
  16. package/lib/config/DB.js.map +1 -1
  17. package/lib/engine/Filesystem/FolderManager.js +2 -1
  18. package/lib/engine/Filesystem/FolderManager.js.map +1 -1
  19. package/lib/server/config/keys.js +10 -2
  20. package/lib/server/config/keys.js.map +1 -1
  21. package/lib/server/config/server.js +1 -0
  22. package/lib/server/config/server.js.map +1 -1
  23. package/lib/server/controller/Database/Databse.controller.d.ts +52 -0
  24. package/lib/server/controller/Database/Databse.controller.js +119 -0
  25. package/lib/server/controller/Database/Databse.controller.js.map +1 -0
  26. package/lib/server/public/AxioControl/.vite/manifest.json +1 -1
  27. package/lib/server/public/AxioControl/.vite/ssr-manifest.json +51 -0
  28. package/lib/server/public/AxioControl/assets/index-wYypOXlX.js +56 -0
  29. package/lib/server/public/AxioControl/index.html +1 -1
  30. package/lib/server/public/AxioControl/sw.js +1 -1
  31. package/lib/server/router/Router.d.ts +6 -2
  32. package/lib/server/router/Router.js +10 -2
  33. package/lib/server/router/Router.js.map +1 -1
  34. package/lib/server/router/Routers/DB.routes.d.ts +7 -0
  35. package/lib/server/router/Routers/DB.routes.js +29 -0
  36. package/lib/server/router/Routers/DB.routes.js.map +1 -0
  37. package/package.json +1 -1
  38. package/lib/server/public/AxioControl/assets/index-HpIfPLrM.js +0 -51
@@ -25,7 +25,7 @@
25
25
  <meta name="twitter:card" content="summary_large_image" />
26
26
  <link rel="canonical" href="https://axiodb.site" />
27
27
  <link rel="icon" type="image/svg+xml" href="AXioDB.png" />
28
- <script type="module" crossorigin src="/assets/index-HpIfPLrM.js"></script>
28
+ <script type="module" crossorigin src="/assets/index-wYypOXlX.js"></script>
29
29
  <link rel="stylesheet" crossorigin href="/assets/index-CrwYZikH.css">
30
30
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
31
31
 
@@ -1 +1 @@
1
- if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const l=e=>s(e,t),c={module:{uri:t},exports:o,require:l};i[t]=Promise.all(n.map(e=>c[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-5ffe50d4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-CrwYZikH.css",revision:null},{url:"assets/index-HpIfPLrM.js",revision:null},{url:"index.html",revision:"09580358f28bacba554a34733c647ffe"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"531c27931688c6a365595ec1badc959b"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
1
+ if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const l=e=>s(e,t),c={module:{uri:t},exports:o,require:l};i[t]=Promise.all(n.map(e=>c[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-5ffe50d4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-CrwYZikH.css",revision:null},{url:"assets/index-wYypOXlX.js",revision:null},{url:"index.html",revision:"492b5b13f02d44cf947eb7578c93f361"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"531c27931688c6a365595ec1badc959b"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
@@ -1,9 +1,13 @@
1
1
  import { FastifyInstance, FastifyPluginOptions } from "fastify";
2
+ import { AxioDB } from "../../Services/Indexation.operation";
3
+ interface RouterOptions extends FastifyPluginOptions {
4
+ AxioDBInstance: AxioDB;
5
+ }
2
6
  /**
3
7
  * Main router plugin for the AxioDB server
4
- *
5
8
  * @param fastify - Fastify instance
6
9
  * @param _options - Plugin options
7
10
  * @param done - Callback to signal completion
8
11
  */
9
- export default function mainRouter(fastify: FastifyInstance, _options: FastifyPluginOptions, done: () => void): Promise<void>;
12
+ export default function mainRouter(fastify: FastifyInstance, options: RouterOptions, done: () => void): Promise<void>;
13
+ export {};
@@ -17,15 +17,18 @@ const keys_1 = require("../config/keys");
17
17
  const responseBuilder_helper_1 = __importDefault(require("../helper/responseBuilder.helper"));
18
18
  const outers_1 = require("outers");
19
19
  const promises_1 = require("node:fs/promises");
20
+ // All Sub Routers
21
+ const DB_routes_1 = __importDefault(require("./Routers/DB.routes"));
20
22
  /**
21
23
  * Main router plugin for the AxioDB server
22
- *
23
24
  * @param fastify - Fastify instance
24
25
  * @param _options - Plugin options
25
26
  * @param done - Callback to signal completion
26
27
  */
27
- function mainRouter(fastify, _options, done) {
28
+ function mainRouter(fastify, options, done) {
28
29
  return __awaiter(this, void 0, void 0, function* () {
30
+ // Now you can access the AxioDB instance
31
+ const { AxioDBInstance } = options;
29
32
  fastify.get("/info", () => __awaiter(this, void 0, void 0, function* () {
30
33
  const PackageFile = JSON.parse(yield (0, promises_1.readFile)("./package.json", "utf-8"));
31
34
  const Reply = (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.OK, "AxioDB Information", {
@@ -49,6 +52,11 @@ function mainRouter(fastify, _options, done) {
49
52
  const Reply = (0, responseBuilder_helper_1.default)(outers_1.StatusCodes.OK, "Available routes", keys_1.AvailableRoutes);
50
53
  return reply.status(200).send(Reply);
51
54
  }));
55
+ // Register the DB router
56
+ fastify.register(DB_routes_1.default, {
57
+ prefix: "/db",
58
+ AxioDBInstance: AxioDBInstance, // Pass the AxioDB instance to the DB router
59
+ });
52
60
  // Handle 404 Not Found
53
61
  fastify.setNotFoundHandler((request, reply) => {
54
62
  return reply
@@ -1 +1 @@
1
- {"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../source/server/router/Router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAwBA,6BA0DC;AAhFD,yCAAiD;AACjD,8FAE0C;AAC1C,mCAAqC;AACrC,+CAA4C;AAU5C;;;;;;GAMG;AACH,SAA8B,UAAU,CACtC,OAAwB,EACxB,QAA8B,EAC9B,IAAgB;;QAEhB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAS,EAAE;YAC9B,MAAM,WAAW,GAAqB,IAAI,CAAC,KAAK,CAC9C,MAAM,IAAA,mBAAQ,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAC1C,CAAC;YACF,MAAM,KAAK,GAAoB,IAAA,gCAAa,EAC1C,oBAAW,CAAC,EAAE,EACd,oB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AAe,CAChB,CAAC;YACF,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC,CAAA,CAAC,CAAC;QAEH,yBAAyB;QACzB,OAAO,CAAC,QAAQ,CAAC,mBAAQ,EAAE;YACzB,MAAM,EAAE,KAAK;YACb,cAAc,EAAE,cAAc,EAAE,4CAA4C;SAC7E,CAAC,CAAC;QAEH,uBAAuB;QACvB,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAC5C,OAAO,KAAK;iBACT,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"}
@@ -0,0 +1,7 @@
1
+ import { FastifyInstance, FastifyPluginOptions } from "fastify";
2
+ import { AxioDB } from "../../../Services/Indexation.operation";
3
+ interface RouterOptions extends FastifyPluginOptions {
4
+ AxioDBInstance: AxioDB;
5
+ }
6
+ export default function dbRouter(fastify: FastifyInstance, options: RouterOptions): Promise<void>;
7
+ export {};
@@ -0,0 +1,29 @@
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 = dbRouter;
16
+ const Databse_controller_1 = __importDefault(require("../../controller/Database/Databse.controller"));
17
+ // DB Routers
18
+ function dbRouter(fastify, options) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const { AxioDBInstance } = options; // Access the AxioDB instance passed from the main router
21
+ // Get all databases
22
+ fastify.get("/databases", () => __awaiter(this, void 0, void 0, function* () { return new Databse_controller_1.default(AxioDBInstance).getDatabases(); }));
23
+ // Create a new database
24
+ fastify.post("/create-database", (request) => __awaiter(this, void 0, void 0, function* () { return new Databse_controller_1.default(AxioDBInstance).createDatabase(request); }));
25
+ // Delete a database
26
+ fastify.delete("/delete-database", (request) => __awaiter(this, void 0, void 0, function* () { return new Databse_controller_1.default(AxioDBInstance).deleteDatabase(request); }));
27
+ });
28
+ }
29
+ //# sourceMappingURL=DB.routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DB.routes.js","sourceRoot":"","sources":["../../../../source/server/router/Routers/DB.routes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,2BAoBC;AA5BD,sGAA8E;AAO9E,aAAa;AACb,SAA8B,QAAQ,CACpC,OAAwB,EACxB,OAAsB;;QAEtB,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,CAAC,yDAAyD;QAE7F,oBAAoB;QACpB,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,GAAS,EAAE,gDACnC,OAAA,IAAI,4BAAkB,CAAC,cAAc,CAAC,CAAC,YAAY,EAAE,CAAA,GAAA,CACtD,CAAC;QAEF,wBAAwB;QACxB,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAO,OAAO,EAAE,EAAE,gDACjD,OAAA,IAAI,4BAAkB,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA,GAAA,CAC/D,CAAC;QAEF,oBAAoB;QACpB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAO,OAAO,EAAE,EAAE,gDACnD,OAAA,IAAI,4BAAkB,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA,GAAA,CAC/D,CAAC;IACJ,CAAC;CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axiodb",
3
- "version": "2.19.65",
3
+ "version": "2.20.66",
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",