This commit is contained in:
Benjamin Toby
2024-12-06 11:44:26 +01:00
parent 1ab41929b2
commit c49513c189
54 changed files with 628 additions and 425 deletions
+8 -14
View File
@@ -1,36 +1,30 @@
export = uploadImage;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
export = deleteFile;
/**
* @typedef {Object} FunctionReturn
* @property {boolean} success - Did the function run successfully?
* @property {{
* urlPath: string,
* urlThumbnailPath: string
* }} payload - Payload containing the url for the image and its thumbnail
* } | null} payload - Payload containing the url for the image and its thumbnail
* @property {string} [msg] - An optional message
*/
/**
* ==============================================================================
* Main Function
* ==============================================================================
* # Delete File via API
* @async
*
* @param {Object} params - Single Param object containing params
* @param {String} params.key - *FULL ACCESS API Key
* @param { string } params.url - File URL
* @param { string | number } [params.user_id]
*
* @returns { Promise<FunctionReturn> } - Image Url
*/
declare function uploadImage({ key, url }: {
declare function deleteFile({ key, url, user_id }: {
key: string;
url: string;
user_id?: string | number;
}): Promise<FunctionReturn>;
declare namespace uploadImage {
declare namespace deleteFile {
export { FunctionReturn };
}
type FunctionReturn = {
@@ -44,7 +38,7 @@ type FunctionReturn = {
payload: {
urlPath: string;
urlThumbnailPath: string;
};
} | null;
/**
* - An optional message
*/
+1 -7
View File
@@ -1,10 +1,4 @@
export = getSchema;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* @typedef {Object} GetSchemaReturn
* @property {boolean} success - Did the function run successfully?
@@ -16,7 +10,7 @@ export = getSchema;
*
* @returns { Promise<GetSchemaReturn> } - Return Object
*/
declare function getSchema({ key, database, field, table }: import("../package-shared/types").GetSchemaAPIParam): Promise<GetSchemaReturn>;
declare function getSchema({ key, database, field, table, user_id }: import("../package-shared/types").GetSchemaAPIParam): Promise<GetSchemaReturn>;
declare namespace getSchema {
export { GetSchemaReturn };
}
+4 -14
View File
@@ -1,10 +1,4 @@
export = get;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* Make a get request to Datasquirel API
* ==============================================================================
@@ -16,21 +10,17 @@ export = get;
* @param {string} params.query - SQL Query
* @param {string[]} [params.queryValues] - An array of query values if using "?" placeholders
* @param {string} [params.tableName] - Name of the table to query
* @param {boolean} [params.useLocal] - Whether to use a remote database instead of API
* @param {boolean} [params.user_id] - User ID
*
* @returns { Promise<import("../package-shared/types").GetReturn> } - Return Object
*/
declare function get({
key,
db,
query,
queryValues,
tableName,
useLocal,
}: {
declare function get({ key, db, query, queryValues, tableName, useLocal, user_id, }: {
key?: string;
db?: string;
query: string;
queryValues?: string[];
tableName?: string;
useLocal?: boolean;
user_id?: boolean;
}): Promise<import("../package-shared/types").GetReturn>;
+5 -16
View File
@@ -1,13 +1,6 @@
export = post;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* Make a post request to Datasquirel API
* ==============================================================================
* # Make a post request to Datasquirel API
* @async
*
* @param {Object} params - Single object passed
@@ -16,21 +9,17 @@ export = post;
* @param {import("../package-shared/types").PostDataPayload | string} params.query - SQL query String or Request Object
* @param {any[]} [params.queryValues] - Query Values if using "?" placeholders
* @param {string} [params.tableName] - Name of the table to query
* @param {boolean} [params.useLocal] - Whether to use a remote database instead of API
* @param {boolean} [params.user_id] - User ID
*
* @returns { Promise<import("../package-shared/types").PostReturn> } - Return Object
*/
declare function post({
key,
query,
queryValues,
database,
tableName,
useLocal,
}: {
declare function post({ key, query, queryValues, database, tableName, useLocal, user_id, }: {
key?: string;
database?: string;
query: import("../package-shared/types").PostDataPayload | string;
queryValues?: any[];
tableName?: string;
useLocal?: boolean;
user_id?: boolean;
}): Promise<import("../package-shared/types").PostReturn>;
+5 -11
View File
@@ -1,10 +1,4 @@
export = uploadImage;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* @typedef {Object} FunctionReturn
* @property {boolean} success - Did the function run successfully?
@@ -14,9 +8,7 @@ export = uploadImage;
* @property {string} [msg] - An optional message
*/
/**
* ==============================================================================
* Main Function
* ==============================================================================
* # Upload File via API
* @async
*
* @param {Object} params - Single Param object containing params
@@ -26,12 +18,13 @@ export = uploadImage;
* fileName: string,
* mimeType?: string,
* folder?: string,
* isPrivate?: boolean,
* isPrivate?: boolean
* }} params.payload - Image Data Eg.
* @param {boolean} [params.user_id] - User ID
*
* @returns { Promise<FunctionReturn> } - Return Object
*/
declare function uploadImage({ key, payload }: {
declare function uploadImage({ key, payload, user_id }: {
key: string;
payload: {
fileData: string;
@@ -40,6 +33,7 @@ declare function uploadImage({ key, payload }: {
folder?: string;
isPrivate?: boolean;
};
user_id?: boolean;
}): Promise<FunctionReturn>;
declare namespace uploadImage {
export { FunctionReturn };
+4 -10
View File
@@ -1,10 +1,4 @@
export = uploadImage;
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* @typedef {Object} FunctionReturn
* @property {boolean} success - Did the function run successfully?
@@ -15,9 +9,7 @@ export = uploadImage;
* @property {string} [msg] - An optional message
*/
/**
* ==============================================================================
* Main Function
* ==============================================================================
* # Upload Image via API
* @async
*
* @param {Object} params - Single Param object containing params
@@ -30,10 +22,11 @@ export = uploadImage;
* folder?: string,
* isPrivate?: boolean,
* }} params.payload - Image Data Eg.
* @param {boolean} [params.user_id] - User ID
*
* @returns { Promise<FunctionReturn> } - Return Object
*/
declare function uploadImage({ key, payload }: {
declare function uploadImage({ key, payload, user_id }: {
key: string;
payload: {
imageData: string;
@@ -43,6 +36,7 @@ declare function uploadImage({ key, payload }: {
folder?: string;
isPrivate?: boolean;
};
user_id?: boolean;
}): Promise<FunctionReturn>;
declare namespace uploadImage {
export { FunctionReturn };