Roll Back compile version

This commit is contained in:
Benjamin Toby
2025-07-05 16:14:11 +01:00
parent 4f4eb44a98
commit 728183b827
251 changed files with 10169 additions and 7458 deletions
+30 -13
View File
@@ -1,15 +1,32 @@
import path from "path";
import queryDSQLAPI from "../../functions/api/query-dsql-api";
import grabAPIBasePath from "../../utils/grab-api-base-path";
export default async function apiCrudDELETE({ dbName, tableName, deleteSpec, targetID, apiKey }) {
const basePath = grabAPIBasePath({ paradigm: "crud" });
const finalID = typeof targetID === "number" ? String(targetID) : targetID;
const finalPath = path.join(basePath, dbName, tableName, finalID || "");
const GET_RES = await queryDSQLAPI({
method: "DELETE",
path: finalPath,
body: deleteSpec,
apiKey,
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = apiCrudDELETE;
const path_1 = __importDefault(require("path"));
const query_dsql_api_1 = __importDefault(require("../../functions/api/query-dsql-api"));
const grab_api_base_path_1 = __importDefault(require("../../utils/grab-api-base-path"));
function apiCrudDELETE(_a) {
return __awaiter(this, arguments, void 0, function* ({ dbName, tableName, deleteSpec, targetID, apiKey }) {
const basePath = (0, grab_api_base_path_1.default)({ paradigm: "crud" });
const finalID = typeof targetID === "number" ? String(targetID) : targetID;
const finalPath = path_1.default.join(basePath, dbName, tableName, finalID || "");
const GET_RES = yield (0, query_dsql_api_1.default)({
method: "DELETE",
path: finalPath,
body: deleteSpec,
apiKey,
});
return GET_RES;
});
return GET_RES;
}
+30 -13
View File
@@ -1,15 +1,32 @@
import path from "path";
import queryDSQLAPI from "../../functions/api/query-dsql-api";
import grabAPIBasePath from "../../utils/grab-api-base-path";
export default async function apiCrudGET({ dbName, tableName, query, targetId, apiKey, }) {
const basePath = grabAPIBasePath({ paradigm: "crud" });
const finalID = typeof targetId === "number" ? String(targetId) : targetId;
const finalPath = path.join(basePath, dbName, tableName, finalID || "");
const GET_RES = await queryDSQLAPI({
method: "GET",
path: finalPath,
query,
apiKey,
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = apiCrudGET;
const path_1 = __importDefault(require("path"));
const query_dsql_api_1 = __importDefault(require("../../functions/api/query-dsql-api"));
const grab_api_base_path_1 = __importDefault(require("../../utils/grab-api-base-path"));
function apiCrudGET(_a) {
return __awaiter(this, arguments, void 0, function* ({ dbName, tableName, query, targetId, apiKey, }) {
const basePath = (0, grab_api_base_path_1.default)({ paradigm: "crud" });
const finalID = typeof targetId === "number" ? String(targetId) : targetId;
const finalPath = path_1.default.join(basePath, dbName, tableName, finalID || "");
const GET_RES = yield (0, query_dsql_api_1.default)({
method: "GET",
path: finalPath,
query,
apiKey,
});
return GET_RES;
});
return GET_RES;
}
+25 -11
View File
@@ -1,12 +1,26 @@
import apiCrudGET from "./get";
import apiCrudPOST from "./post";
import apiCrudPUT from "./put";
import apiCrudDELETE from "./delete";
const crud = {
get: apiCrudGET,
insert: apiCrudPOST,
update: apiCrudPUT,
delete: apiCrudDELETE,
options: async () => { },
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
export default crud;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const get_1 = __importDefault(require("./get"));
const post_1 = __importDefault(require("./post"));
const put_1 = __importDefault(require("./put"));
const delete_1 = __importDefault(require("./delete"));
const crud = {
get: get_1.default,
insert: post_1.default,
update: put_1.default,
delete: delete_1.default,
options: () => __awaiter(void 0, void 0, void 0, function* () { }),
};
exports.default = crud;
+35 -18
View File
@@ -1,20 +1,37 @@
import path from "path";
import queryDSQLAPI from "../../functions/api/query-dsql-api";
import grabAPIBasePath from "../../utils/grab-api-base-path";
export default async function apiCrudPOST({ dbName, tableName, body, update, apiKey, }) {
const basePath = grabAPIBasePath({ paradigm: "crud" });
const passedID = body.id;
const finalID = update
? typeof passedID === "number"
? String(passedID)
: passedID
: undefined;
const finalPath = path.join(basePath, dbName, tableName, finalID || "");
const GET_RES = await queryDSQLAPI({
method: update ? "PUT" : "POST",
path: finalPath,
body,
apiKey,
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = apiCrudPOST;
const path_1 = __importDefault(require("path"));
const query_dsql_api_1 = __importDefault(require("../../functions/api/query-dsql-api"));
const grab_api_base_path_1 = __importDefault(require("../../utils/grab-api-base-path"));
function apiCrudPOST(_a) {
return __awaiter(this, arguments, void 0, function* ({ dbName, tableName, body, update, apiKey, }) {
const basePath = (0, grab_api_base_path_1.default)({ paradigm: "crud" });
const passedID = body.id;
const finalID = update
? typeof passedID === "number"
? String(passedID)
: passedID
: undefined;
const finalPath = path_1.default.join(basePath, dbName, tableName, finalID || "");
const GET_RES = yield (0, query_dsql_api_1.default)({
method: update ? "PUT" : "POST",
path: finalPath,
body,
apiKey,
});
return GET_RES;
});
return GET_RES;
}
+29 -12
View File
@@ -1,14 +1,31 @@
import apiCrudPOST from "./post";
export default async function apiCrudPUT({ dbName, tableName, body, targetID, apiKey }) {
const updatedBody = Object.assign({}, body);
if (targetID) {
updatedBody["id"] = targetID;
}
return await apiCrudPOST({
dbName,
tableName,
body: updatedBody,
update: true,
apiKey,
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = apiCrudPUT;
const post_1 = __importDefault(require("./post"));
function apiCrudPUT(_a) {
return __awaiter(this, arguments, void 0, function* ({ dbName, tableName, body, targetID, apiKey }) {
const updatedBody = Object.assign({}, body);
if (targetID) {
updatedBody["id"] = targetID;
}
return yield (0, post_1.default)({
dbName,
tableName,
body: updatedBody,
update: true,
apiKey,
});
});
}