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:
@@ -11,19 +11,20 @@ import {
|
||||
import resolveArticleBySku from './resolveArticleBySku.js';
|
||||
import request from '../request.js';
|
||||
|
||||
/**
|
||||
* Deletes an article by its SKU, refusing when it still has children.
|
||||
*
|
||||
* @param {object} pool - The mssql connection pool.
|
||||
* @returns {Function} An async function that deletes an article.
|
||||
*
|
||||
* @example
|
||||
* const fn = del(pool);
|
||||
* await fn(42, 'SKU-1');
|
||||
*/
|
||||
export default function del(pool) {
|
||||
const resolve = resolveArticleBySku(pool);
|
||||
|
||||
/**
|
||||
* Deletes an article by its SKU, refusing when it still has children.
|
||||
*
|
||||
* @param {number} googleAuthId - The id of the Google auth user.
|
||||
* @param {string} sku - The article SKU.
|
||||
* @returns {Promise<void>}
|
||||
* @throws {Error} If the article has children or is not found.
|
||||
*
|
||||
* @example
|
||||
* await store.article.delete(42, 'SKU-1');
|
||||
*/
|
||||
return async (googleAuthId, sku) => {
|
||||
const { articleId, languageId } = await resolve(googleAuthId, sku);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user