This commit is contained in:
Benjamin Toby
2025-07-05 14:59:30 +01:00
parent 6e334c2525
commit 7e8bb37c09
526 changed files with 17560 additions and 11386 deletions
+5
View File
@@ -0,0 +1,5 @@
import { APIResponseObject } from "../../types";
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
export default function apiMediaDELETE(params: {
mediaID?: string | number;
}): Promise<APIResponseObject<DSQL_DATASQUIREL_USER_MEDIA | DSQL_DATASQUIREL_USER_MEDIA[]>>;
+17
View File
@@ -0,0 +1,17 @@
import queryDSQLAPI from "../../functions/api/query-dsql-api";
import path from "path";
import grabAPIBasePath from "../../utils/grab-api-base-path";
export default async function apiMediaDELETE(params) {
const basePath = grabAPIBasePath({ paradigm: "media" });
const mediaID = params.mediaID
? typeof params.mediaID === "number"
? String(params.mediaID)
: params.mediaID
: undefined;
const finalPath = path.join(basePath, mediaID || "");
const DELETE_MEDIA_RES = await queryDSQLAPI({
method: "DELETE",
path: finalPath,
});
return DELETE_MEDIA_RES;
}
+3
View File
@@ -0,0 +1,3 @@
import { APIGetMediaParams, APIResponseObject } from "../../types";
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
export default function apiMediaGET(params: APIGetMediaParams): Promise<APIResponseObject<DSQL_DATASQUIREL_USER_MEDIA | DSQL_DATASQUIREL_USER_MEDIA[]>>;
+18
View File
@@ -0,0 +1,18 @@
import queryDSQLAPI from "../../functions/api/query-dsql-api";
import path from "path";
import grabAPIBasePath from "../../utils/grab-api-base-path";
export default async function apiMediaGET(params) {
const basePath = grabAPIBasePath({ paradigm: "media" });
const mediaID = params.mediaID
? typeof params.mediaID === "number"
? String(params.mediaID)
: params.mediaID
: undefined;
const finalPath = path.join(basePath, mediaID || "");
const GET_MEDIA_RES = await queryDSQLAPI({
method: "GET",
path: finalPath,
query: params,
});
return GET_MEDIA_RES;
}
+9
View File
@@ -0,0 +1,9 @@
import apiMediaGET from "./get";
import apiMediaPOST from "./post";
import apiMediaDELETE from "./delete";
declare const media: {
get: typeof apiMediaGET;
add: typeof apiMediaPOST;
delete: typeof apiMediaDELETE;
};
export default media;
+9
View File
@@ -0,0 +1,9 @@
import apiMediaGET from "./get";
import apiMediaPOST from "./post";
import apiMediaDELETE from "./delete";
const media = {
get: apiMediaGET,
add: apiMediaPOST,
delete: apiMediaDELETE,
};
export default media;
+3
View File
@@ -0,0 +1,3 @@
import { AddMediaAPIBody, APIResponseObject } from "../../types";
import { DSQL_DATASQUIREL_USER_MEDIA } from "../../types/dsql";
export default function apiMediaPOST(params: AddMediaAPIBody): Promise<APIResponseObject<DSQL_DATASQUIREL_USER_MEDIA | DSQL_DATASQUIREL_USER_MEDIA[]>>;
+11
View File
@@ -0,0 +1,11 @@
import queryDSQLAPI from "../../functions/api/query-dsql-api";
import grabAPIBasePath from "../../utils/grab-api-base-path";
export default async function apiMediaPOST(params) {
const basePath = grabAPIBasePath({ paradigm: "media" });
const POST_MEDIA_RES = await queryDSQLAPI({
method: "POST",
path: basePath,
body: params,
});
return POST_MEDIA_RES;
}