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 {
|
||||
import resolveSelectedCompanyAccess from '../companyuser/resolveSelectedCompanyAccess.js';
|
||||
import shapeSetting from './shapeSetting.js';
|
||||
|
||||
/**
|
||||
* Lists the settings of a company, optionally only frontend-visible ones.
|
||||
*
|
||||
* @param {object} pool - The mssql connection pool.
|
||||
* @returns {Function} An async function that lists company settings.
|
||||
*
|
||||
* @example
|
||||
* const fn = list(pool);
|
||||
* const settings = await fn(42, { frontendOnly: true });
|
||||
* // => [{ key, value, frontend }]
|
||||
*/
|
||||
export default function list(pool) {
|
||||
const access = resolveSelectedCompanyAccess(pool);
|
||||
|
||||
/**
|
||||
* Lists the settings of the user's selected company, optionally only frontend-visible ones.
|
||||
*
|
||||
* @param {number} googleAuthId - The id of the Google auth user.
|
||||
* @param {object} [options] - Optional options.
|
||||
* @param {boolean} [options.frontendOnly] - Only return frontend-visible settings.
|
||||
* @returns {Promise<Array<{key: string, value: string, frontend: boolean}>>} The settings.
|
||||
*
|
||||
* @example
|
||||
* const settings = await store.companysetting.list(42, { frontendOnly: true });
|
||||
* // => [{ key, value, frontend }]
|
||||
*/
|
||||
return async (googleAuthId, { frontendOnly = false } = {}) => {
|
||||
const { companyId } = await access(googleAuthId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user