feat: manage files via manifestattachment with auth and cascade trigger, format API.md method signatures
This commit is contained in:
@@ -26,6 +26,7 @@ const MODULE_ORDER = [
|
||||
'delivery',
|
||||
'quote',
|
||||
'order',
|
||||
'manifestattachment',
|
||||
'posterminal',
|
||||
'google_auth',
|
||||
'pic',
|
||||
@@ -51,6 +52,7 @@ const INTERNAL_FILES = new Set([
|
||||
'resolveEntityAccess.js',
|
||||
'resolvePicAccess.js',
|
||||
'resolveArticleBySku.js',
|
||||
'resolveManifestAccess.js',
|
||||
'queryBySku.js',
|
||||
'queryCategoryArticles.js',
|
||||
'getCategoryPosterminalIds.js',
|
||||
@@ -193,6 +195,10 @@ function buildModules() {
|
||||
});
|
||||
}
|
||||
|
||||
for (const entries of modules.values()) {
|
||||
entries.sort((a, b) => a.name.localeCompare(b.name));
|
||||
}
|
||||
|
||||
return modules;
|
||||
}
|
||||
|
||||
@@ -249,6 +255,21 @@ function renderSection(moduleName, entries) {
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
function formatMethodSignature(entry) {
|
||||
const topLevelParams = (entry.params || []).filter((p) => !p.name.includes('.'));
|
||||
const paramsStr = topLevelParams
|
||||
.map((p) => {
|
||||
const isOptional = p.name.startsWith('[');
|
||||
const cleanName = p.name.replace(/^\[|\]$/g, '').split('=')[0].trim();
|
||||
const typeStr = p.type ? `: ${p.type}` : '';
|
||||
return `${cleanName}${isOptional ? '?' : ''}${typeStr}`;
|
||||
})
|
||||
.join(', ');
|
||||
|
||||
const returnType = entry.returns?.type ? `: ${entry.returns.type}` : ': void';
|
||||
return `(${paramsStr})${returnType}`;
|
||||
}
|
||||
|
||||
function render() {
|
||||
const modules = buildModules();
|
||||
|
||||
@@ -282,6 +303,11 @@ function render() {
|
||||
|
||||
for (const { moduleName } of written) {
|
||||
lines.push(`- [${moduleName}](API.${moduleName}.md)`);
|
||||
const entries = modules.get(moduleName) || [];
|
||||
for (const entry of entries) {
|
||||
const sig = formatMethodSignature(entry);
|
||||
lines.push(` - \`${entry.name}${sig}\``);
|
||||
}
|
||||
}
|
||||
|
||||
lines.push('');
|
||||
|
||||
Reference in New Issue
Block a user