docs: add JSDoc headers to all externally exported store functions

This commit is contained in:
seb
2026-08-07 03:58:48 +02:00
parent c290fe8f4b
commit 4833acd680
101 changed files with 1134 additions and 0 deletions

View File

@@ -1,6 +1,17 @@
import { GET_FULL_BY_HASH } from '../../sql/pic.js';
import resolvePicAccess from './resolvePicAccess.js';
/**
* Returns the full-size image (AVIF) for a given hash.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that fetches a full image by hash.
*
* @example
* const fn = getImageByHash(pool);
* const image = await fn(42, 'abc123');
* // => { buffer, w, h, size, contentType: 'image/avif' }
*/
export default function getImageByHash(pool) {
const authorize = resolvePicAccess(pool);

View File

@@ -1,6 +1,17 @@
import { GET_THUMB_BY_HASH } from '../../sql/pic.js';
import resolvePicAccess from './resolvePicAccess.js';
/**
* Returns the thumbnail image (AVIF) for a given hash.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that fetches a thumbnail by hash.
*
* @example
* const fn = getThumbByHash(pool);
* const thumb = await fn(42, 'abc123');
* // => { buffer, w, h, contentType: 'image/avif' }
*/
export default function getThumbByHash(pool) {
const authorize = resolvePicAccess(pool);