From 8782c08bf90de558addf9621c2225733adc45b49 Mon Sep 17 00:00:00 2001 From: Tben <52448020+BenjaminToby@users.noreply.github.com> Date: Mon, 22 May 2023 09:23:21 +0100 Subject: [PATCH] updates --- package.json | 2 +- utils/upload-image.js | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index fa94c7d..341b08d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.1.9", + "version": "1.1.10", "description": "Cloud-based SQL data management tool", "main": "index.js", "scripts": { diff --git a/utils/upload-image.js b/utils/upload-image.js index 1146a8a..f1aad82 100644 --- a/utils/upload-image.js +++ b/utils/upload-image.js @@ -12,17 +12,30 @@ const https = require("https"); /** ****************************************************************************** */ /** ****************************************************************************** */ +/** + * @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 + */ + /** * ============================================================================== * Main Function * ============================================================================== - * @param {String} key - API Key - * @param {Object} payload - Image Data Eg. { - imageData: imageBase64, - imageName: `cast_cord_user_${newUser.payload.insertId}`, - mimeType: "jpg", - thumbnailSize: 120, - } + * @param {Object} params - API Key + * @param {String} params.key - API Key + * @param {{ + * imageData: string, + * imageName: string, + * mimeType: [string], + * thumbnailSize: [number], + * folder: [string], + * }} params.payload - Image Data Eg. + * + * @returns { Promise } - Return Object */ module.exports = async function ({ key, payload }) { /**