This commit is contained in:
Tben 2023-05-23 16:26:05 +01:00
parent 0497d678d9
commit 9987b19c34
5 changed files with 46 additions and 7 deletions

View File

@ -3,8 +3,8 @@
* Imports * Imports
* ============================================================================== * ==============================================================================
*/ */
import imageInputFileToBase64 from "./media/imageInputFileToBase64"; const imageInputFileToBase64 = require("./media/imageInputFileToBase64");
import imageInputToBase64 from "./media/imageInputToBase64"; const imageInputToBase64 = require("./media/imageInputToBase64");
/** ****************************************************************************** */ /** ****************************************************************************** */
/** ****************************************************************************** */ /** ****************************************************************************** */

39
client/media/client.js Normal file
View File

@ -0,0 +1,39 @@
/**
* ==============================================================================
* Imports
* ==============================================================================
*/
import imageInputFileToBase64 from "./imageInputFileToBase64";
import imageInputToBase64 from "./imageInputToBase64";
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/**
* ==============================================================================
* Media Functions Object
* ==============================================================================
*/
const media = {
imageInputToBase64: imageInputToBase64,
imageInputFileToBase64: imageInputFileToBase64,
};
/**
* ==============================================================================
* Main Export
* ==============================================================================
*/
const datasquirelClient = {
media: media,
};
export default datasquirelClient;
/** ********************************************** */
/** ********************************************** */
/** ********************************************** */

View File

@ -21,7 +21,7 @@
* *
* @returns { Promise<FunctionReturn> } - Return Object * @returns { Promise<FunctionReturn> } - Return Object
*/ */
export default async function imageInputFileToBase64({ imageInputFile, maxWidth, imagePreviewNode }) { module.exports = async function imageInputFileToBase64({ imageInputFile, maxWidth, imagePreviewNode }) {
/** /**
* Make https request * Make https request
* *
@ -108,7 +108,7 @@ export default async function imageInputFileToBase64({ imageInputFile, maxWidth,
imageSize: null, imageSize: null,
}; };
} }
} };
/** ********************************************** */ /** ********************************************** */
/** ********************************************** */ /** ********************************************** */

View File

@ -20,7 +20,7 @@
* *
* @returns { Promise<FunctionReturn> } - Return Object * @returns { Promise<FunctionReturn> } - Return Object
*/ */
export default async function imageInputToBase64({ imageInput, maxWidth, mimeType }) { module.exports = async function imageInputToBase64({ imageInput, maxWidth, mimeType }) {
/** /**
* Make https request * Make https request
* *
@ -94,7 +94,7 @@ export default async function imageInputToBase64({ imageInput, maxWidth, mimeTyp
imageName: null, imageName: null,
}; };
} }
} };
/** ********************************************** */ /** ********************************************** */
/** ********************************************** */ /** ********************************************** */

View File

@ -1,6 +1,6 @@
{ {
"name": "datasquirel", "name": "datasquirel",
"version": "1.1.32", "version": "1.1.33",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {