Rewrite store JSDoc, split quote/order into modules, and generate typed API docs
- Rewrite JSDoc across all store methods to document the actual async methods (real params, returns, throws) instead of the internal wrappers - Split quote/order into individual module files backed by shared manifestDoc helpers; remove the createStore factory and thin wrappers - Deduplicate manifest line helpers into src/store/manifestLines.js - Extend generate-api-doc.js to render parameter/return/throws types and emit per-namespace API.<module>.md files with an API.md index - Regenerate all API docs
This commit is contained in:
@@ -5,20 +5,21 @@ import newFullHash from '../../util/newFullHash.js';
|
||||
import request from '../request.js';
|
||||
import resolveCategoryAccess from './resolveCategoryAccess.js';
|
||||
|
||||
/**
|
||||
* Adds an image to a category, processing it into AVIF full and thumb variants.
|
||||
*
|
||||
* @param {object} pool - The mssql connection pool.
|
||||
* @returns {Function} An async function that adds a category image.
|
||||
*
|
||||
* @example
|
||||
* const fn = addImage(pool);
|
||||
* const result = await fn(42, 5, imageBuffer);
|
||||
* // => { id, fullHash, thumbW, thumbH, thumbHash }
|
||||
*/
|
||||
export default function addImage(pool) {
|
||||
const access = resolveCategoryAccess(pool);
|
||||
|
||||
/**
|
||||
* Adds an image to a category, processing it into AVIF full and thumb variants.
|
||||
*
|
||||
* @param {number} googleAuthId - The id of the Google auth user.
|
||||
* @param {number} categoryId - The id of the category.
|
||||
* @param {Buffer} image - The source image buffer.
|
||||
* @returns {Promise<{id: number, fullHash: string, thumbW: number, thumbH: number, thumbHash: string}>} The added image info.
|
||||
*
|
||||
* @example
|
||||
* const result = await store.category.addImage(42, 5, imageBuffer);
|
||||
* // => { id, fullHash, thumbW, thumbH, thumbHash }
|
||||
*/
|
||||
return async (googleAuthId, categoryId, image) => {
|
||||
await access(googleAuthId, categoryId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user