@skspwork/config-doc 2.3.0-beta.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skspwork/config-doc",
|
|
3
|
-
"version": "2.3.0
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Interactive documentation tool for JSON configuration files (appsettings.json)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "cd packages/web && npm install && npm run build && cd ../.. && node scripts/prepare-standalone.js",
|
|
45
45
|
"prepublishOnly": "npm run build",
|
|
46
|
-
"test:publish": "npm run build && npm pack && npx skspwork-config-doc-2.0.
|
|
46
|
+
"test:publish": "npm run build && npm pack && npx skspwork-config-doc-2.3.0.tgz",
|
|
47
47
|
"unlink": "npm unlink -g @skspwork/config-doc"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -971,7 +971,7 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
971
971
|
renderTree(tree, treeEl);
|
|
972
972
|
}
|
|
973
973
|
|
|
974
|
-
// 検索フィルタを適用(ツリー項目のフィルタリング -
|
|
974
|
+
// 検索フィルタを適用(ツリー項目のフィルタリング - プロパティ名、パス、タグ、フィールド値を検索)
|
|
975
975
|
function applySearchFilter(query) {
|
|
976
976
|
const config = configs[activeConfigIndex];
|
|
977
977
|
const items = document.querySelectorAll('.tree-item');
|
|
@@ -986,14 +986,33 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
986
986
|
matched = true;
|
|
987
987
|
}
|
|
988
988
|
|
|
989
|
-
//
|
|
989
|
+
// ドキュメント(タグとフィールド内容)でも検索
|
|
990
990
|
if (!matched) {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
991
|
+
// テンプレート継承も考慮してドキュメントを取得
|
|
992
|
+
const doc = findAndMergeDocumentation(
|
|
993
|
+
item.dataset.path,
|
|
994
|
+
config.docs.properties,
|
|
995
|
+
config.configData
|
|
996
|
+
);
|
|
997
|
+
|
|
998
|
+
if (doc) {
|
|
999
|
+
// タグで検索
|
|
1000
|
+
if (doc.tags && Array.isArray(doc.tags)) {
|
|
1001
|
+
for (const tag of doc.tags) {
|
|
1002
|
+
if (tag && tag.toLowerCase().includes(query)) {
|
|
1003
|
+
matched = true;
|
|
1004
|
+
break;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
// フィールド内容で検索
|
|
1010
|
+
if (!matched && doc.fields) {
|
|
1011
|
+
for (const [label, value] of Object.entries(doc.fields)) {
|
|
1012
|
+
if (value && value.toLowerCase().includes(query)) {
|
|
1013
|
+
matched = true;
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
997
1016
|
}
|
|
998
1017
|
}
|
|
999
1018
|
}
|
|
@@ -1046,7 +1065,7 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
1046
1065
|
renderCurrentConfig();
|
|
1047
1066
|
setupSearch();
|
|
1048
1067
|
}
|
|
1049
|
-
`}}class
|
|
1068
|
+
`}}class A{static flattenConfig(e,t=""){let a={};for(let r in e){let n=t?`${t}:${r}`:r,i=e[r];i&&"object"==typeof i?Array.isArray(i)?i.some(e=>e&&"object"==typeof e&&!Array.isArray(e))?i.forEach((e,t)=>{e&&"object"==typeof e&&!Array.isArray(e)&&Object.assign(a,this.flattenConfig(e,`${n}[${t}]`))}):a[n]=i:Object.assign(a,this.flattenConfig(i,n)):a[n]=i}return a}static getAllPropertyPaths(e,t=""){let a=[];for(let r in e){let n=t?`${t}:${r}`:r,i=e[r];a.push(n),i&&"object"==typeof i&&(Array.isArray(i)?i.some(e=>e&&"object"==typeof e&&!Array.isArray(e))&&i.forEach((e,t)=>{if(e&&"object"==typeof e&&!Array.isArray(e)){let r=`${n}[${t}]`;a.push(r),a.push(...this.getAllPropertyPaths(e,r))}}):a.push(...this.getAllPropertyPaths(i,n)))}return a}static buildTree(e,t=""){let a=[];for(let r in e){let n=t?`${t}:${r}`:r,i=e[r];if(i&&"object"==typeof i)if(Array.isArray(i))if(i.some(e=>e&&"object"==typeof e&&!Array.isArray(e))){let e=[];i.forEach((t,a)=>{t&&"object"==typeof t&&!Array.isArray(t)&&e.push({key:`[${a}]`,fullPath:`${n}[${a}]`,value:t,children:this.buildTree(t,`${n}[${a}]`),hasDocumentation:!1,type:"object"})}),a.push({key:r,fullPath:n,value:i,children:e.length>0?e:void 0,hasDocumentation:!1,type:"array"})}else a.push({key:r,fullPath:n,value:i,hasDocumentation:!1,type:"array"});else a.push({key:r,fullPath:n,value:i,children:this.buildTree(i,n),hasDocumentation:!1,type:"object"});else a.push({key:r,fullPath:n,value:i,hasDocumentation:!1,type:typeof i})}return a}}function C(e,t){return[...e].sort((e,a)=>{let r=t.indexOf(e),n=t.indexOf(a);return -1!==r&&-1!==n?r-n:-1===r?1:-1===n?-1:0})}var $=e.i(61958);class S{rootPath;constructor(e){this.rootPath=e}async generateMarkdownForFile(e){let t=new P.FileSystemService(this.rootPath),a=new x.StorageService(t),r=await t.loadProjectSettings(),n=r?.fields?Object.keys(r.fields):[],i=r?.availableTags||[],o=e.split(/[/\\]/).pop()||"config.json",s=await a.loadAllDocs(e),l=await t.loadConfigFile(e),c=s.associativeArrays||[],d=`# ${o}
|
|
1050
1069
|
|
|
1051
1070
|
`;d+=`**ファイルパス:** \`${e}\`
|
|
1052
1071
|
|
|
@@ -1054,13 +1073,13 @@ module.exports=[47482,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250
|
|
|
1054
1073
|
|
|
1055
1074
|
---
|
|
1056
1075
|
|
|
1057
|
-
`;let p=
|
|
1076
|
+
`;let p=A.getAllPropertyPaths(l);if(0===p.length)d+="*プロパティがありません。*\n\n";else for(let e of(d+="## プロパティ一覧\n\n",p)){let t=(0,$.findAndMergeDocumentation)(e,s.properties,c,l),a=j(l,e);if(d+=`### \`${e}\`
|
|
1058
1077
|
|
|
1059
1078
|
`,null!=a){let e=typeof a,t=Array.isArray(a),r="object"===e&&!t;t?a.length>0&&a.every(e=>"object"!=typeof e||null===e)&&(d+=`**値:** \`${w(JSON.stringify(a))}\`
|
|
1060
1079
|
|
|
1061
1080
|
`):r||(d+=`**値:** \`${w(String(a))}\`
|
|
1062
1081
|
|
|
1063
|
-
`)}if(t){if(t.tags&&t.tags.length>0){let e=
|
|
1082
|
+
`)}if(t){if(t.tags&&t.tags.length>0){let e=C(t.tags,i);d+=`**タグ:** ${e.map(e=>`\`${e}\``).join(", ")}
|
|
1064
1083
|
|
|
1065
1084
|
`}if(t.fields)for(let e of n){let a=t.fields[e];a&&(d+=`**${e}:**
|
|
1066
1085
|
|
|
@@ -1078,13 +1097,13 @@ ${w(a)}
|
|
|
1078
1097
|
|
|
1079
1098
|
**ファイルパス:** \`${o}\`
|
|
1080
1099
|
|
|
1081
|
-
`;let c=
|
|
1100
|
+
`;let c=A.getAllPropertyPaths(l);if(0===c.length){i+="*プロパティがありません。*\n\n";continue}i+="### プロパティ一覧\n\n";let d=s.associativeArrays||[];for(let e of c){let t=(0,$.findAndMergeDocumentation)(e,s.properties,d,l),a=j(l,e);if(i+=`#### \`${e}\`
|
|
1082
1101
|
|
|
1083
1102
|
`,null!=a){let e=typeof a,t=Array.isArray(a),r="object"===e&&!t;t?a.length>0&&a.every(e=>"object"!=typeof e||null===e)&&(i+=`**値:** \`${w(JSON.stringify(a))}\`
|
|
1084
1103
|
|
|
1085
1104
|
`):r||(i+=`**値:** \`${w(String(a))}\`
|
|
1086
1105
|
|
|
1087
|
-
`)}if(t){if(t.tags&&t.tags.length>0){let e=
|
|
1106
|
+
`)}if(t){if(t.tags&&t.tags.length>0){let e=C(t.tags,n);i+=`**タグ:** ${e.map(e=>`\`${e}\``).join(", ")}
|
|
1088
1107
|
|
|
1089
1108
|
`}if(t.fields)for(let e of r){let a=t.fields[e];a&&(i+=`**${e}:**
|
|
1090
1109
|
|
|
@@ -1100,7 +1119,7 @@ ${w(a)}
|
|
|
1100
1119
|
|
|
1101
1120
|
---
|
|
1102
1121
|
|
|
1103
|
-
`;let p=
|
|
1122
|
+
`;let p=A.getAllPropertyPaths(c);if(0===p.length)d+="*プロパティがありません。*\n\n";else{for(let e of(d+="| プロパティ名 | タグ | 値 |",n.forEach(e=>{d+=` ${e} |`}),d+="\n|-------------|------|-----|",n.forEach(()=>{d+="------|"}),d+="\n",p)){let t=(0,$.findAndMergeDocumentation)(e,s.properties,l,c),a=v(e),r=t&&t.tags&&t.tags.length>0?C(t.tags,i):[],o=r.length>0?v(r.map(e=>`\`${e}\``).join(", ")):"-",p=v(this.getPropertyValue(c,e));d+=`| ${a} | ${o} | ${p} |`,n.forEach(e=>{let a=t&&t.fields&&t.fields[e]||"-";d+=` ${v(a)} |`}),d+="\n"}d+="\n"}return d+=`
|
|
1104
1123
|
*このドキュメントは ConfigDoc により自動生成されました。*
|
|
1105
1124
|
`}async generateMarkdownTable(){let e=new P.FileSystemService(this.rootPath),t=new x.StorageService(e),a=await e.loadProjectSettings();if(!a||0===a.configFiles.length)return"# 設定ファイルドキュメント\n\nドキュメント化された設定ファイルがありません。\n";let r=a.fields?Object.keys(a.fields):[],n=a.availableTags||[],i="# 設定ファイルドキュメント\n\n";for(let o of(i+=`プロジェクト: **${a.projectName}**
|
|
1106
1125
|
|
|
@@ -1112,8 +1131,8 @@ ${w(a)}
|
|
|
1112
1131
|
|
|
1113
1132
|
**ファイルパス:** \`${o}\`
|
|
1114
1133
|
|
|
1115
|
-
`;let c=
|
|
1134
|
+
`;let c=A.getAllPropertyPaths(l);if(0===c.length){i+="*プロパティがありません。*\n\n";continue}i+="| プロパティ名 | タグ | 値 |",r.forEach(e=>{i+=` ${e} |`}),i+="\n|-------------|------|-----|",r.forEach(()=>{i+="------|"}),i+="\n";let d=s.associativeArrays||[];for(let e of c){let t=(0,$.findAndMergeDocumentation)(e,s.properties,d,l),a=v(e),o=t&&t.tags&&t.tags.length>0?C(t.tags,n):[],c=o.length>0?v(o.map(e=>`\`${e}\``).join(", ")):"-",p=v(this.getPropertyValue(l,e));i+=`| ${a} | ${c} | ${p} |`,r.forEach(e=>{let a=t&&t.fields&&t.fields[e]||"-";i+=` ${v(a)} |`}),i+="\n"}i+="\n"}return i+=`
|
|
1116
1135
|
*このドキュメントは ConfigDoc により自動生成されました。*
|
|
1117
|
-
`}getPropertyValue(e,t){var a=j(e,t);if(null==a)return"-";let r=typeof a,n=Array.isArray(a);return n?a.length>0&&a.every(e=>"object"!=typeof e||null===e)?JSON.stringify(a):"-":"object"!==r||n?String(a):"-"}}var O=e.i(10720),T=e.i(14747),N=e.i(24868);async function F(e){try{let t,a=(0,O.getRootPath)();try{t=await e.json()}catch{t={}}let{format:r="html"}=t,n=t.fileName?.trim()||"config-doc",i=t.outputDir?.trim()||"",o=new P.FileSystemService(a);await o.ensureConfigDocDir();let s=i?T.default.join(a,i):a;if(await N.default.mkdir(s,{recursive:!0}),"markdown"===r){let e=await o.loadProjectSettings();if(!e||0===e.configFiles.length)return b.NextResponse.json({success:!1,error:"ドキュメント化された設定ファイルがありません"},{status:400});let t=new S(a),r=[];for(let a of e.configFiles){let e=(a.split(/[/\\]/).pop()||"config.json").replace(/\.json$/i,".md"),n=T.default.join(s,e),i=await t.generateMarkdownForFile(a);await N.default.writeFile(n,i,"utf-8"),r.push(n)}return b.NextResponse.json({success:!0,message:`Markdownファイルを${r.length}件生成しました`,outputPaths:r})}if("markdown-table"===r){let e=await o.loadProjectSettings();if(!e||0===e.configFiles.length)return b.NextResponse.json({success:!1,error:"ドキュメント化された設定ファイルがありません"},{status:400});let t=new E(a),r=[];for(let a of e.configFiles){let e=(a.split(/[/\\]/).pop()||"config.json").replace(/\.json$/i,".md"),n=T.default.join(s,e),i=await t.generateMarkdownTableForFile(a);await N.default.writeFile(n,i,"utf-8"),r.push(n)}return b.NextResponse.json({success:!0,message:`Markdownテーブルファイルを${r.length}件生成しました`,outputPaths:r})}let l=new k(a),c=await l.generateHtml(),d=`${n}.html`,p=T.default.join(s,d);return await N.default.writeFile(p,c,"utf-8"),b.NextResponse.json({success:!0,message:"HTMLファイルを生成しました",outputPath:p})}catch(e){return console.error("API Error:",e),b.NextResponse.json({success:!1,error:e instanceof Error?e.message:"Unknown error"},{status:500})}}e.s(["POST",()=>F],49588);var I=e.i(49588);let R=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/export/route",pathname:"/api/export",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/export/route.ts",nextConfigOutput:"standalone",userland:I}),{workAsyncStorage:M,workUnitAsyncStorage:H,serverHooks:z}=R;function L(){return(0,r.patchFetch)({workAsyncStorage:M,workUnitAsyncStorage:H})}async function B(e,t,r){R.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let b="/api/export/route";b=b.replace(/\/index$/,"")||"/";let P=await R.prepare(e,t,{srcPage:b,multiZoneDraftMode:!1});if(!P)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:x,params:v,nextConfig:w,parsedUrl:D,isDraftMode:j,prerenderManifest:k,routerServerContext:
|
|
1136
|
+
`}getPropertyValue(e,t){var a=j(e,t);if(null==a)return"-";let r=typeof a,n=Array.isArray(a);return n?a.length>0&&a.every(e=>"object"!=typeof e||null===e)?JSON.stringify(a):"-":"object"!==r||n?String(a):"-"}}var O=e.i(10720),T=e.i(14747),N=e.i(24868);async function F(e){try{let t,a=(0,O.getRootPath)();try{t=await e.json()}catch{t={}}let{format:r="html"}=t,n=t.fileName?.trim()||"config-doc",i=t.outputDir?.trim()||"",o=new P.FileSystemService(a);await o.ensureConfigDocDir();let s=i?T.default.join(a,i):a;if(await N.default.mkdir(s,{recursive:!0}),"markdown"===r){let e=await o.loadProjectSettings();if(!e||0===e.configFiles.length)return b.NextResponse.json({success:!1,error:"ドキュメント化された設定ファイルがありません"},{status:400});let t=new S(a),r=[];for(let a of e.configFiles){let e=(a.split(/[/\\]/).pop()||"config.json").replace(/\.json$/i,".md"),n=T.default.join(s,e),i=await t.generateMarkdownForFile(a);await N.default.writeFile(n,i,"utf-8"),r.push(n)}return b.NextResponse.json({success:!0,message:`Markdownファイルを${r.length}件生成しました`,outputPaths:r})}if("markdown-table"===r){let e=await o.loadProjectSettings();if(!e||0===e.configFiles.length)return b.NextResponse.json({success:!1,error:"ドキュメント化された設定ファイルがありません"},{status:400});let t=new E(a),r=[];for(let a of e.configFiles){let e=(a.split(/[/\\]/).pop()||"config.json").replace(/\.json$/i,".md"),n=T.default.join(s,e),i=await t.generateMarkdownTableForFile(a);await N.default.writeFile(n,i,"utf-8"),r.push(n)}return b.NextResponse.json({success:!0,message:`Markdownテーブルファイルを${r.length}件生成しました`,outputPaths:r})}let l=new k(a),c=await l.generateHtml(),d=`${n}.html`,p=T.default.join(s,d);return await N.default.writeFile(p,c,"utf-8"),b.NextResponse.json({success:!0,message:"HTMLファイルを生成しました",outputPath:p})}catch(e){return console.error("API Error:",e),b.NextResponse.json({success:!1,error:e instanceof Error?e.message:"Unknown error"},{status:500})}}e.s(["POST",()=>F],49588);var I=e.i(49588);let R=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/export/route",pathname:"/api/export",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/export/route.ts",nextConfigOutput:"standalone",userland:I}),{workAsyncStorage:M,workUnitAsyncStorage:H,serverHooks:z}=R;function L(){return(0,r.patchFetch)({workAsyncStorage:M,workUnitAsyncStorage:H})}async function B(e,t,r){R.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let b="/api/export/route";b=b.replace(/\/index$/,"")||"/";let P=await R.prepare(e,t,{srcPage:b,multiZoneDraftMode:!1});if(!P)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:x,params:v,nextConfig:w,parsedUrl:D,isDraftMode:j,prerenderManifest:k,routerServerContext:A,isOnDemandRevalidate:C,revalidateOnlyGenerated:$,resolvedPathname:S,clientReferenceManifest:E,serverActionsManifest:O}=P,T=(0,s.normalizeAppPath)(b),N=!!(k.dynamicRoutes[T]||k.routes[S]),F=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,D,!1):t.end("This page could not be found"),null);if(N&&!j){let e=!!k.routes[S],t=k.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(w.experimental.adapterPath)return await F();throw new m.NoFallbackError}}let I=null;!N||R.isDev||j||(I="/index"===(I=S)?"/":I);let M=!0===R.isDev||!N,H=N&&!M;O&&E&&(0,o.setManifestsSingleton)({page:b,clientReferenceManifest:E,serverActionsManifest:O});let z=e.method||"GET",L=(0,i.getTracer)(),B=L.getActiveScopeSpan(),U={params:v,prerenderManifest:k,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:w.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>R.onRequestError(e,t,r,n,A)},sharedContext:{buildId:x}},q=new l.NodeNextRequest(e),K=new l.NodeNextResponse(t),_=c.NextRequestAdapter.fromNodeNextRequest(q,(0,c.signalFromNodeResponse)(t));try{let o=async e=>R.handle(_,U).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let a=L.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route");if(r){let t=`${z} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t)}else e.updateName(`${z} ${b}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var i,l;let c=async({previousCacheEntry:a})=>{try{if(!s&&C&&$&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=U.renderOpts.fetchMetrics;let l=U.renderOpts.pendingWaitUntil;l&&r.waitUntil&&(r.waitUntil(l),l=void 0);let c=U.renderOpts.collectedTags;if(!N)return await (0,f.sendResponse)(q,K,i,U.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);c&&(t[g.NEXT_CACHE_TAGS_HEADER]=c),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,r=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await R.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:C})},!1,A),t}},d=await R.handleResponse({req:e,nextConfig:w,cacheKey:I,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:$,responseGenerator:c,waitUntil:r.waitUntil,isMinimalMode:s});if(!N)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",C?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),j&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return s&&N||m.delete(g.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,u.getCacheControlHeader)(d.cacheControl)),await (0,f.sendResponse)(q,K,new Response(d.value.body,{headers:m,status:d.value.status||200})),null};B?await l(B):await L.withPropagatedContext(e.headers,()=>L.trace(d.BaseServerSpan.handleRequest,{spanName:`${z} ${b}`,kind:i.SpanKind.SERVER,attributes:{"http.method":z,"http.target":e.url}},l))}catch(t){if(t instanceof m.NoFallbackError||await R.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:C})},!1,A),N)throw t;return await (0,f.sendResponse)(q,K,new Response(null,{status:500})),null}}e.s(["handler",()=>B,"patchFetch",()=>L,"routeModule",()=>R,"serverHooks",()=>z,"workAsyncStorage",()=>M,"workUnitAsyncStorage",()=>H],47482)}];
|
|
1118
1137
|
|
|
1119
1138
|
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_d09de205.js.map
|