Updates
This commit is contained in:
@@ -9,11 +9,15 @@ type Params<T extends { [key: string]: any } = { [key: string]: any }> = {
|
||||
deleteSpec?: T & { deleteKeyValues?: SQLDeleteData<T>[] };
|
||||
targetID?: string | number;
|
||||
apiKey?: string;
|
||||
/**
|
||||
* # Query datasquirel.com
|
||||
*/
|
||||
useDefault?: boolean;
|
||||
};
|
||||
|
||||
export default async function apiCrudDELETE<
|
||||
T extends { [key: string]: any } = { [key: string]: any }
|
||||
>({ dbName, tableName, deleteSpec, targetID, apiKey }: Params<T>) {
|
||||
>({ dbName, tableName, deleteSpec, targetID, apiKey, useDefault }: Params<T>) {
|
||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||
|
||||
const finalID = typeof targetID === "number" ? String(targetID) : targetID;
|
||||
@@ -25,6 +29,7 @@ export default async function apiCrudDELETE<
|
||||
path: finalPath,
|
||||
body: deleteSpec,
|
||||
apiKey,
|
||||
useDefault,
|
||||
});
|
||||
|
||||
return GET_RES;
|
||||
|
||||
@@ -9,6 +9,10 @@ type Params<T extends { [key: string]: any } = { [key: string]: any }> = {
|
||||
query?: DsqlCrudQueryObject<T>;
|
||||
targetId?: string | number;
|
||||
apiKey?: string;
|
||||
/**
|
||||
* # Query datasquirel.com
|
||||
*/
|
||||
useDefault?: boolean;
|
||||
};
|
||||
|
||||
export default async function apiCrudGET<
|
||||
@@ -19,6 +23,7 @@ export default async function apiCrudGET<
|
||||
query,
|
||||
targetId,
|
||||
apiKey,
|
||||
useDefault,
|
||||
}: Params<T>): Promise<APIResponseObject> {
|
||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||
|
||||
@@ -31,6 +36,7 @@ export default async function apiCrudGET<
|
||||
path: finalPath,
|
||||
query,
|
||||
apiKey,
|
||||
useDefault,
|
||||
});
|
||||
|
||||
return GET_RES;
|
||||
|
||||
@@ -11,6 +11,10 @@ export type APICrudPostParams<
|
||||
body: T;
|
||||
update?: boolean;
|
||||
apiKey?: string;
|
||||
/**
|
||||
* # Query datasquirel.com
|
||||
*/
|
||||
useDefault?: boolean;
|
||||
};
|
||||
|
||||
export default async function apiCrudPOST<
|
||||
@@ -21,6 +25,7 @@ export default async function apiCrudPOST<
|
||||
body,
|
||||
update,
|
||||
apiKey,
|
||||
useDefault,
|
||||
}: APICrudPostParams<T>): Promise<APIResponseObject> {
|
||||
const basePath = grabAPIBasePath({ paradigm: "crud" });
|
||||
|
||||
@@ -39,6 +44,7 @@ export default async function apiCrudPOST<
|
||||
path: finalPath,
|
||||
body,
|
||||
apiKey,
|
||||
useDefault,
|
||||
});
|
||||
|
||||
return GET_RES;
|
||||
|
||||
@@ -7,6 +7,10 @@ import grabAPIBasePath from "../../utils/grab-api-base-path";
|
||||
type Params = {
|
||||
mediaID?: string | number;
|
||||
apiKey?: string;
|
||||
/**
|
||||
* # Query datasquirel.com
|
||||
*/
|
||||
useDefault?: boolean;
|
||||
};
|
||||
|
||||
export default async function apiMediaDELETE(
|
||||
@@ -30,6 +34,7 @@ export default async function apiMediaDELETE(
|
||||
method: "DELETE",
|
||||
path: finalPath,
|
||||
apiKey: params.apiKey,
|
||||
useDefault: params.useDefault,
|
||||
});
|
||||
|
||||
return DELETE_MEDIA_RES as APIResponseObject<
|
||||
|
||||
@@ -26,6 +26,7 @@ export default async function apiMediaGET(
|
||||
path: finalPath,
|
||||
query: params,
|
||||
apiKey: params.apiKey,
|
||||
useDefault: params.useDefault,
|
||||
});
|
||||
|
||||
return GET_MEDIA_RES as APIResponseObject<
|
||||
|
||||
@@ -17,6 +17,7 @@ export default async function apiMediaPOST(
|
||||
path: basePath,
|
||||
body: params,
|
||||
apiKey: params.apiKey,
|
||||
useDefault: params.useDefault,
|
||||
});
|
||||
|
||||
return POST_MEDIA_RES as APIResponseObject<
|
||||
|
||||
@@ -2271,6 +2271,10 @@ export type APIGetMediaParams = {
|
||||
stream?: "stream";
|
||||
thumbnail?: "true" | "false";
|
||||
apiKey?: string;
|
||||
/**
|
||||
* # Query datasquirel.com
|
||||
*/
|
||||
useDefault?: boolean;
|
||||
};
|
||||
|
||||
export type AddMediaAPIBody = {
|
||||
@@ -2278,4 +2282,8 @@ export type AddMediaAPIBody = {
|
||||
folder?: string | null;
|
||||
type: (typeof MediaTypes)[number];
|
||||
apiKey?: string;
|
||||
/**
|
||||
* # Query datasquirel.com
|
||||
*/
|
||||
useDefault?: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user