@karan171996/metricflow 0.1.2 → 0.1.5
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -2
- package/.next/build-manifest.json +3 -3
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +11 -11
- package/.next/routes-manifest.json +23 -3
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +2 -3
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +9 -10
- package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -3
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +3 -3
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +10 -10
- package/.next/server/app/_not-found.segments/_full.segment.rsc +10 -10
- package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/analyze/route.js +3 -2
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/connect/route.js +2 -2
- package/.next/server/app/api/connect/route.js.nft.json +1 -1
- package/.next/server/app/api/metrics/route.js +2 -2
- package/.next/server/app/api/metrics/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/settings/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/settings/route.js +6 -0
- package/.next/server/app/api/settings/route.js.nft.json +1 -0
- package/.next/server/app/api/settings/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/setup/ai/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/setup/ai/route/build-manifest.json +12 -0
- package/.next/server/app/api/setup/ai/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/setup/ai/route.js +7 -0
- package/.next/server/app/api/setup/ai/route.js.nft.json +1 -0
- package/.next/server/app/api/setup/ai/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/setup/route.js +2 -2
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/connect/page.js +3 -3
- package/.next/server/app/connect/page.js.nft.json +1 -1
- package/.next/server/app/connect/page_client-reference-manifest.js +1 -1
- package/.next/server/app/connect.html +2 -2
- package/.next/server/app/connect.rsc +12 -12
- package/.next/server/app/connect.segments/_full.segment.rsc +12 -12
- package/.next/server/app/connect.segments/_index.segment.rsc +8 -8
- package/.next/server/app/connect.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/connect.segments/connect/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/icon.svg/route/app-paths-manifest.json +3 -0
- package/.next/server/app/icon.svg/route/build-manifest.json +12 -0
- package/.next/server/app/icon.svg/route.js +7 -0
- package/.next/server/app/{favicon.ico → icon.svg}/route.js.nft.json +1 -1
- package/.next/server/app/icon.svg.body +4 -0
- package/.next/server/app/icon.svg.meta +1 -0
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +12 -12
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +12 -12
- package/.next/server/app/index.segments/_index.segment.rsc +8 -8
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/performance/[slug]/page.js +5 -4
- package/.next/server/app/performance/[slug]/page.js.nft.json +1 -1
- package/.next/server/app/performance/[slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/performance/page.js +3 -3
- package/.next/server/app/performance/page.js.nft.json +1 -1
- package/.next/server/app/performance/page_client-reference-manifest.js +1 -1
- package/.next/server/app/performance.html +2 -2
- package/.next/server/app/performance.rsc +13 -13
- package/.next/server/app/performance.segments/_full.segment.rsc +13 -13
- package/.next/server/app/performance.segments/_index.segment.rsc +8 -8
- package/.next/server/app/performance.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/performance.segments/performance/__PAGE__.segment.rsc +27 -26
- package/.next/server/app/settings/page.js +4 -4
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings.html +2 -2
- package/.next/server/app/settings.rsc +24 -24
- package/.next/server/app/settings.segments/_full.segment.rsc +24 -24
- package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +20 -20
- package/.next/server/app/setup/page.js +3 -3
- package/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup.html +2 -2
- package/.next/server/app/setup.rsc +31 -30
- package/.next/server/app/setup.segments/_full.segment.rsc +31 -30
- package/.next/server/app/setup.segments/_index.segment.rsc +8 -8
- package/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +25 -24
- package/.next/server/app/tools/[tool]/page/app-paths-manifest.json +3 -0
- package/.next/server/app/tools/[tool]/page/build-manifest.json +19 -0
- package/.next/server/app/tools/[tool]/page/next-font-manifest.json +6 -0
- package/.next/server/app/tools/[tool]/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/tools/[tool]/page/server-reference-manifest.json +4 -0
- package/.next/server/app/tools/[tool]/page.js +17 -0
- package/.next/server/app/tools/[tool]/page.js.nft.json +1 -0
- package/.next/server/app/tools/[tool]/page_client-reference-manifest.js +3 -0
- package/.next/server/app-paths-manifest.json +5 -2
- package/.next/server/chunks/[root-of-the-server]__027a1hx._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0chxb6o._.js → [root-of-the-server]__0eo1oa6._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1l249st._.js → [root-of-the-server]__0vkb6_m._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1d1y03f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1lxxc0h._.js +3 -0
- package/.next/server/chunks/{node_modules_0jatszq._.js → _0g9k22b._.js} +4 -4
- package/.next/server/chunks/_0zwkfj-._.js +8 -0
- package/.next/server/chunks/_10b5gsp._.js +22 -0
- package/.next/server/chunks/_1f-783b._.js +158 -0
- package/.next/server/chunks/_1pe45_3._.js +7 -7
- package/.next/server/chunks/_next-internal_server_app_api_settings_route_actions_1bpm9ac.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_setup_ai_route_actions_0-ay8t8.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_icon_svg_route_actions_1r2h_ub.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__06gb9_u._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0d9igav._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0fufdy-._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__15_sjnx._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__18-cm6x._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1fxaeqo._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1io3bae._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1pm7uf6._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1q99mso._.js +3 -0
- package/.next/server/chunks/ssr/{_1r2qog2._.js → _0-bp5v7._.js} +3 -3
- package/.next/server/chunks/ssr/{_042xeoh._.js → _06r8zrg._.js} +2 -2
- package/.next/server/chunks/ssr/_1-6djlo._.js +3 -0
- package/.next/server/chunks/ssr/{_1n9m819._.js → _1a5owey._.js} +2 -2
- package/.next/server/chunks/ssr/_1b_fov9._.js +3 -0
- package/.next/server/chunks/ssr/_1d1ipgp._.js +1 -1
- package/.next/server/chunks/ssr/_1d74ud1._.js +3 -0
- package/.next/server/chunks/ssr/{_0dbmzjx._.js → _1ovns3l._.js} +3 -151
- package/.next/server/chunks/ssr/_1y-b2zm._.js +151 -0
- package/.next/server/chunks/ssr/_1zb40ot._.js +3 -0
- package/.next/server/chunks/ssr/_20txlee._.js +1 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_tools_[tool]_page_actions_0-u-_p-.js +3 -0
- package/.next/server/chunks/ssr/app_layout_tsx_2144vk_._.js +1 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_0drixxt._.js +151 -0
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/0ubjg1ka_080j.js +1 -0
- package/.next/static/chunks/{14pp7x-su_dnv.js → 19jmme1xtmib0.js} +2 -2
- package/.next/static/chunks/1jtdb3kujnm2_.css +1 -0
- package/.next/static/chunks/{0wyq7u3z0lfca.js → 1kpyel_do_nn_.js} +1 -1
- package/.next/static/chunks/1otvbjuxr6thq.js +1 -0
- package/.next/static/chunks/1wurvq5krow1k.js +1 -0
- package/.next/static/chunks/2bd8yoc_iosfu.js +1 -0
- package/.next/static/chunks/{3lqd2emjcxbd-.js → 2uf-bm2nz17t-.js} +1 -1
- package/.next/static/chunks/32d1qdgpjfhb0.js +4 -0
- package/.next/static/chunks/{2xy80eg_ueu_u.js → 41tx3tz7-8892.js} +1 -1
- package/.next/static/media/icon.23mz8iwcatff2.svg +4 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/LICENSE +21 -0
- package/bin/cli.mjs +7 -2
- package/package.json +4 -2
- package/.next/build/chunks/[root-of-the-server]__05i36w1._.js.map +0 -11
- package/.next/build/chunks/[root-of-the-server]__1kki86f._.js.map +0 -8
- package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_1gfkiq9._.js.map +0 -5
- package/.next/build/chunks/[turbopack]_runtime.js.map +0 -11
- package/.next/build/chunks/node_modules_20v-8wl._.js.map +0 -47
- package/.next/build/chunks/pool_entry-[turbopack-node]_transforms_postcss_ts_0tp-k2v._.js.map +0 -5
- package/.next/server/app/_global-error/page.js.map +0 -5
- package/.next/server/app/_not-found/page.js.map +0 -5
- package/.next/server/app/api/analyze/route.js.map +0 -5
- package/.next/server/app/api/connect/route.js.map +0 -5
- package/.next/server/app/api/health/route.js.map +0 -5
- package/.next/server/app/api/metrics/route.js.map +0 -5
- package/.next/server/app/api/setup/route.js.map +0 -5
- package/.next/server/app/api/timings/route.js.map +0 -5
- package/.next/server/app/connect/page.js.map +0 -5
- package/.next/server/app/favicon.ico/route/app-paths-manifest.json +0 -3
- package/.next/server/app/favicon.ico/route.js +0 -7
- package/.next/server/app/favicon.ico/route.js.map +0 -5
- package/.next/server/app/favicon.ico.body +0 -0
- package/.next/server/app/favicon.ico.meta +0 -1
- package/.next/server/app/page.js.map +0 -5
- package/.next/server/app/performance/[slug]/page.js.map +0 -5
- package/.next/server/app/performance/page.js.map +0 -5
- package/.next/server/app/settings/page.js.map +0 -5
- package/.next/server/app/setup/page.js.map +0 -5
- package/.next/server/chunks/[externals]__1o8qm3w._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__0chxb6o._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__14tfjrn._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1fj5wte._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1i_tsds._.js +0 -22
- package/.next/server/chunks/[root-of-the-server]__1i_tsds._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1l249st._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1uv-wzy._.js.map +0 -1
- package/.next/server/chunks/[turbopack]_runtime.js.map +0 -10
- package/.next/server/chunks/_1494cut._.js.map +0 -1
- package/.next/server/chunks/_1gvvd7n._.js +0 -158
- package/.next/server/chunks/_1gvvd7n._.js.map +0 -1
- package/.next/server/chunks/_1pe45_3._.js.map +0 -1
- package/.next/server/chunks/_1qtlv__._.js.map +0 -1
- package/.next/server/chunks/_next-internal_server_app_api_analyze_route_actions_0lx-23h.js.map +0 -1
- package/.next/server/chunks/_next-internal_server_app_api_connect_route_actions_1r5w03m.js.map +0 -1
- package/.next/server/chunks/_next-internal_server_app_api_health_route_actions_1ryftkb.js.map +0 -1
- package/.next/server/chunks/_next-internal_server_app_api_metrics_route_actions_0qn5q3s.js.map +0 -1
- package/.next/server/chunks/_next-internal_server_app_api_setup_route_actions_0txsuev.js.map +0 -1
- package/.next/server/chunks/_next-internal_server_app_api_timings_route_actions_1tsq7j6.js.map +0 -1
- package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_0g2jjls.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_0g2jjls.js.map +0 -1
- package/.next/server/chunks/node_modules_0jatszq._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__036j_vr._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__036j_vr._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0ev464o._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0ev464o._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0f5axvr._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0f5axvr._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0hg5gib._.js +0 -33
- package/.next/server/chunks/ssr/[root-of-the-server]__0hg5gib._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0tmkhxy._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0tmkhxy._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0ydfg18._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0ydfg18._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__18hr860._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__18w2nrx._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__18w2nrx._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1c8dejo._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1mwg_vi._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1mwg_vi._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1p_6ezv._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1vxra_4._.js.map +0 -1
- package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +0 -10
- package/.next/server/chunks/ssr/_042xeoh._.js.map +0 -1
- package/.next/server/chunks/ssr/_0c7qo1d._.js +0 -3
- package/.next/server/chunks/ssr/_0c7qo1d._.js.map +0 -1
- package/.next/server/chunks/ssr/_0dbmzjx._.js.map +0 -1
- package/.next/server/chunks/ssr/_178o6nh._.js +0 -3
- package/.next/server/chunks/ssr/_178o6nh._.js.map +0 -1
- package/.next/server/chunks/ssr/_1bbiu24._.js +0 -3
- package/.next/server/chunks/ssr/_1bbiu24._.js.map +0 -1
- package/.next/server/chunks/ssr/_1d1ipgp._.js.map +0 -1
- package/.next/server/chunks/ssr/_1n9m819._.js.map +0 -1
- package/.next/server/chunks/ssr/_1p5i72g._.js +0 -151
- package/.next/server/chunks/ssr/_1p5i72g._.js.map +0 -1
- package/.next/server/chunks/ssr/_1r2qog2._.js.map +0 -1
- package/.next/server/chunks/ssr/_1rkc3oc._.js.map +0 -1
- package/.next/server/chunks/ssr/_20txlee._.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yr.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_connect_page_actions_1g-s_3i.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1j.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_performance_[slug]_page_actions_1pzv3w1.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_performance_page_actions_0vi13cc.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_settings_page_actions_11x4dq5.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_setup_page_actions_0u1sm0s.js.map +0 -1
- package/.next/server/chunks/ssr/app_layout_tsx_2144vk_._.js.map +0 -1
- package/.next/server/chunks/ssr/app_loading_tsx_0a1flg9._.js.map +0 -1
- package/.next/server/chunks/ssr/app_performance_[slug]_loading_tsx_0d5z78a._.js.map +0 -1
- package/.next/server/chunks/ssr/app_performance_loading_tsx_1bq2nq9._.js.map +0 -1
- package/.next/server/chunks/ssr/app_settings_loading_tsx_0nv_78v._.js.map +0 -1
- package/.next/server/chunks/ssr/components_0j32dj5._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_1wax83z._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_cn_dist_index_166wuka.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_0nkkbfv._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_1v8aef8._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_server-async-storage_0t1dato.js.map +0 -1
- package/.next/static/chunks/13ihwqjtq_hlo.js +0 -1
- package/.next/static/chunks/1clwpy-vw07cb.js +0 -1
- package/.next/static/chunks/2-llbg7gt2gi5.js +0 -4
- package/.next/static/chunks/28w-hz8hg8t4v.css +0 -1
- package/.next/static/chunks/3rfi1wruz0m51.js +0 -1
- package/.next/static/media/favicon.2vob68tjqpejf.ico +0 -0
- /package/.next/server/app/{favicon.ico → api/settings}/route/build-manifest.json +0 -0
- /package/.next/static/{edA9zyNvRjRViNxMJ7dlC → kitK02ca_n40lM28SxiCO}/_buildManifest.js +0 -0
- /package/.next/static/{edA9zyNvRjRViNxMJ7dlC → kitK02ca_n40lM28SxiCO}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{edA9zyNvRjRViNxMJ7dlC → kitK02ca_n40lM28SxiCO}/_ssgManifest.js +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
var R=require("../../chunks/[turbopack]_runtime.js")("server/app/favicon.ico/route.js")
|
|
2
|
-
R.c("server/chunks/[externals]__1o8qm3w._.js")
|
|
3
|
-
R.c("server/chunks/[root-of-the-server]__1uv-wzy._.js")
|
|
4
|
-
R.c("server/chunks/_1gvvd7n._.js")
|
|
5
|
-
R.c("server/chunks/_next-internal_server_app_favicon_ico_route_actions_0g2jjls.js")
|
|
6
|
-
R.m(6218)
|
|
7
|
-
module.exports=R.m(6218).exports
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"status":200,"headers":{"cache-control":"public, max-age=0, must-revalidate","content-type":"image/x-icon","x-next-cache-tags":"_N_T_/layout,_N_T_/favicon.ico/layout,_N_T_/favicon.ico/route,_N_T_/favicon.ico"},"routeCache":{"key":"/route-cache/APP_ROUTE/adb2ea089a587cf57dd95fa5b11714bc555600b8777692e029801fce568a54ac/$/favicon.ico","owner":{"kind":"APP_ROUTE","sourceRoute":"/favicon.ico/route"},"isFallback":false}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/apiTimingStore.ts","../../../lib/env.ts"],"sourcesContent":["import type { TrafficBarItem } from '@/types';\n\n/**\n * Holds the most recent measured duration of each named external API call\n * (New Relic, Sentry per-page, Gemini), recorded by the route handlers\n * that actually make those calls. Powers the \"Rankings Moved\" card, which\n * shows real call latency ranked slowest-first instead of SEO data (no\n * connected platform has ranking data — this does the same \"ranked bars\"\n * job with something we actually measure).\n *\n * ponytail: in-memory, single-process — resets on dev server restart and\n * isn't shared across serverless instances. Fine for local dev; upgrade\n * to a real store if this needs to survive restarts or aggregate across\n * instances.\n */\nconst timings = new Map<string, number>();\n\nexport function recordTiming(name: string, ms: number) {\n timings.set(name, Math.round(ms));\n}\n\nexport function getTimings(): TrafficBarItem[] {\n return Array.from(timings.entries())\n .map(([name, value]) => ({ name, value }))\n .sort((a, b) => b.value - a.value);\n}\n","import { existsSync, readFileSync, renameSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/** Key name -> label shown on /setup. Order = form order. */\nexport const SETUP_KEYS = [\n 'NEWRELIC_API_KEY',\n 'NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID',\n 'SENTRY_API_KEY',\n 'SENTRY_ORG_SLUG',\n 'SENTRY_PROJECT_ID'\n] as const;\nexport type SetupKey = (typeof SETUP_KEYS)[number];\n/** Sends events from your site (Ingest - License key). Not needed to read data; set on /connect. */\nexport const INSERT_KEY = 'NEWRELIC_INSERT_KEY';\n\n/**\n * Computed-key read: Next inlines literal `process.env.NEXT_PUBLIC_*` at build\n * time, which would freeze the account id before /setup could write it.\n */\nexport function env(name: string): string {\n return process.env[name] ?? '';\n}\n\nexport function isConfigured(): boolean {\n return SETUP_KEYS.every(k => env(k));\n}\n\n/** METRICFLOW_ENV_FILE overrides the target (used by tests so they never touch a real .env.local). */\nexport function envFilePath(): string {\n return process.env.METRICFLOW_ENV_FILE || join(process.cwd(), '.env.local');\n}\n\n/** Merges `values` into .env.local, keeping unrelated lines, and updates process.env so no restart is needed. */\nexport function writeEnvLocal(values: Partial<Record<SetupKey | typeof INSERT_KEY, string>>, path = envFilePath()): void {\n const existing = existsSync(path) ? readFileSync(path, 'utf8').split('\\n') : [];\n const pending = new Map(Object.entries(values));\n const lines = existing.map(line => {\n const name = line.match(/^\\s*([A-Z0-9_]+)\\s*=/)?.[1];\n if (name && pending.has(name)) {\n const v = pending.get(name)!;\n pending.delete(name);\n return `${name}=${v}`;\n }\n return line;\n });\n while (lines.length && lines[lines.length - 1] === '') lines.pop();\n for (const [name, v] of pending) lines.push(`${name}=${v}`);\n\n const tmp = `${path}.tmp`;\n writeFileSync(tmp, lines.join('\\n') + '\\n', { mode: 0o600 });\n renameSync(tmp, path);\n for (const [name, v] of Object.entries(values)) process.env[name] = v;\n}\n"],"names":["timings","Map","recordTiming","name","ms","set","Math","round","getTimings","Array","from","entries","map","value","sort","a","b","SETUP_KEYS","INSERT_KEY","env","process","isConfigured","every","k","envFilePath","METRICFLOW_ENV_FILE","cwd","writeEnvLocal","values","path","existing","split","pending","Object","lines","line","match","has","v","get","delete","length","pop","push","tmp","join","mode"],"mappings":"qhEAeA,IAAMA,EAAU,IAAIC,wBAMb,SAASO,EACd,OAAOC,MAAMC,IAAI,CAACV,EAAQW,OAAO,IAC9BC,GAAG,CAAC,CAAC,CAACT,EAAMU,EAAM,GAAK,CAAC,MAAEV,QAAMU,EAAM,CAAC,EACvCC,IAAI,CAAC,CAACC,EAAGC,IAAMA,EAAEH,KAAK,CAAGE,EAAEF,KAAK,CACrC,mBARO,SAAsBV,AAAbD,CAAyB,CAAEE,CAAU,EACnDJ,EAAQK,GAAG,CAACF,EAAMG,KAAKC,KAAK,CAACH,GAC/B,4BCnBA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OAGO,IAAMa,EAAa,CACxB,mBACA,kCACA,iBACA,kBACA,oBACD,CASM,SAASE,EAAIhB,C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U,EAACF,EAAKf,GACQI,OAAOtB,OAAO,CAACiB,IAASR,QAAQD,GAAG,CAAChB,EAAK,CAAGmC,CACtE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../app/api/timings/route.ts","../../../node_modules/next/src/build/templates/app-route.ts","../../../lib/apiTimingStore.ts"],"sourcesContent":["import { getTimings } from '@/lib/apiTimingStore';\n\nexport async function GET() {\n return Response.json({ items: getTimings() });\n}\n","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport {\n addRequestMeta,\n getRequestMeta,\n setRequestMeta,\n type RequestMeta,\n} from '../../server/request-meta'\nimport {\n getTracer,\n type Span,\n SpanKind,\n SpanStatusCode,\n} from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport { isRouteCacheOwner } from '../../server/lib/route-cache-key'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n // The lazy require factory ensures that:\n // - In dev: devRequestTimingInternalsEnd is set before userland executes,\n // correctly attributing module load time to application-code rather than\n // framework internals.\n // - In all modes: async modules (route files with top-level await) are\n // handled correctly — require() returns a Promise for such modules, which\n // ensureUserland() awaits before the first request is handled.\n userland: () => require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n // In Turbopack dev mode, also provide a synchronous per-request getter so\n // server HMR updates are picked up without re-executing the entry chunk.\n // Using require() (synchronous) avoids adding async overhead that would be\n // incorrectly attributed to application-code time in devRequestTiming.\n ...(process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER\n ? {\n getUserland: () =>\n require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n }\n : {}),\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil?: (prom: Promise<void>) => void\n requestMeta?: RequestMeta\n }\n) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta)\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n deploymentId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n // Only this route's prerenders can establish ISR or admit generated params.\n const isPrerendered =\n Boolean(prerenderManifest.routes[resolvedPathname]) &&\n (routeModule.isDev ||\n isRouteCacheOwner(\n resolvedPathname,\n routeModule.cacheOwner,\n prerenderManifest.routes[resolvedPathname]\n ))\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n const isWrappedByNextServer = Boolean(\n routerServerContext?.isWrappedByNextServer\n )\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n const incrementalCache =\n getRequestMeta(req, 'incrementalCache') ||\n (await routeModule.getIncrementalCache(\n req,\n nextConfig,\n prerenderManifest,\n isMinimalMode\n ))\n\n incrementalCache?.resetRequestCache()\n ;(globalThis as any).__incrementalCache = incrementalCache\n\n const context: AppRouteRouteHandlerContext = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n useCacheTimeout: nextConfig.experimental.useCacheTimeout,\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n validationLevel: nextConfig.experimental.instantInsights.validationLevel,\n isDraftMode,\n supportsDynamicResponse,\n incrementalCache,\n hmrRefreshHash: getRequestMeta(req, 'hmrRefreshHash'),\n cacheLifeProfiles: nextConfig.cacheLife,\n staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n deploymentId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await routeModule.handle(nextReq, context)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? // Fall back to the global `expireTime` config when the\n // route has a numeric `revalidate` but didn't declare an\n // explicit `expire` (e.g. via `cacheLife`). This mirrors the\n // build-time fallback in `build/index.ts` so cache entries\n // and the response Cache-Control header agree on the route's\n // effective expire. Routes that opt out of revalidation\n // (`revalidate: false`) or that are dynamic (`revalidate: 0`)\n // keep `expire: undefined`.\n revalidate !== false && revalidate > 0\n ? nextConfig.expireTime\n : undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, pendingWaitUntil)\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const handleResponse = async (\n currentSpan: Span | undefined,\n parentSpan: Span | undefined\n ) => {\n try {\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return\n } finally {\n ;(() => {\n if (!currentSpan) {\n return\n }\n\n let statusCode = res.statusCode\n\n currentSpan.setAttributes({\n 'http.status_code': statusCode,\n 'next.rsc': false,\n })\n\n if (statusCode && statusCode >= 500) {\n // For 5xx status codes: SHOULD be set to 'Error' span status.\n // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status\n currentSpan.setStatus({\n code: SpanStatusCode.ERROR,\n })\n // For span status 'Error', SHOULD set 'error.type' attribute.\n currentSpan.setAttribute('error.type', statusCode.toString())\n }\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route') || normalizedSrcPage\n const name = `${method} ${route}`\n\n currentSpan.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n currentSpan.updateName(name)\n\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== currentSpan) {\n parentSpan.setAttribute('http.route', route)\n parentSpan.updateName(name)\n }\n })()\n }\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan, undefined)\n } else {\n let parentSpan = tracer.getActiveScopeSpan()\n await tracer.withPropagatedContext(\n req.headers,\n () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n (span) => handleResponse(span, parentSpan)\n ),\n undefined,\n !isWrappedByNextServer\n )\n }\n}\n","import type { TrafficBarItem } from '@/types';\n\n/**\n * Holds the most recent measured duration of each named external API call\n * (New Relic, Sentry per-page, Gemini), recorded by the route handlers\n * that actually make those calls. Powers the \"Rankings Moved\" card, which\n * shows real call latency ranked slowest-first instead of SEO data (no\n * connected platform has ranking data — this does the same \"ranked bars\"\n * job with something we actually measure).\n *\n * ponytail: in-memory, single-process — resets on dev server restart and\n * isn't shared across serverless instances. Fine for local dev; upgrade\n * to a real store if this needs to survive restarts or aggregate across\n * instances.\n */\nconst timings = new Map<string, number>();\n\nexport function recordTiming(name: string, ms: number) {\n timings.set(name, Math.round(ms));\n}\n\nexport function getTimings(): TrafficBarItem[] {\n return Array.from(timings.entries())\n .map(([name, value]) => ({ name, value }))\n .sort((a, b) => b.value - a.value);\n}\n"],"names":["GET","Response","json","items","AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","setRequestMeta","getTracer","SpanKind","SpanStatusCode","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","isRouteCacheOwner","CachedRouteKind","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","userland","require","TURBOPACK","__NEXT_DEV_SERVER","getUserland","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","req","res","ctx","requestMeta","isDev","hrtime","bigint","srcPage","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","deploymentId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isPrerendered","Boolean","routes","cacheOwner","isIsr","dynamicRoutes","render404","prerenderInfo","fallback","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","isWrappedByNextServer","isMinimalMode","incrementalCache","getIncrementalCache","resetRequestCache","globalThis","__incrementalCache","context","previewProps","preview","renderOpts","experimental","authInterrupts","useCacheTimeout","cacheComponents","validationLevel","instantInsights","hmrRefreshHash","cacheLifeProfiles","cacheLife","staticPageGenerationTimeout","onClose","cb","on","onAfterTaskError","undefined","onInstrumentationRequestError","error","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","responseGenerator","previousCacheEntry","setHeader","response","handle","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","headers","type","revalidate","collectedRevalidate","expire","collectedExpire","expireTime","cacheEntry","value","status","body","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","handleResponse","currentSpan","parentSpan","routeKind","isFallback","isRoutePPREnabled","Error","isMiss","delete","getHeader","get","set","setAttributes","setStatus","code","ERROR","setAttribute","toString","rootSpanAttributes","getRootSpanAttributes","handleRequest","console","warn","route","name","updateName","withPropagatedContext","trace","spanName","SERVER","attributes","url","span","timings","Map","recordTiming","ms","Math","round","getTimings","Array","entries","map","sort","a","b"],"mappings":"+gCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEO,eAAeA,IACpB,OAAOC,SAASC,IAAI,CAAC,CAAEC,MAAO,CAAA,EAAA,EAAA,UAAA,AAAU,GAAG,EAC7C,0CCJA,IAAA,EAIO,EAAA,CAAA,AAHLC,CAGK,OACP,EAA0B,EAAyB,CAA1CC,AAA0C,CAAA,GAAA,EAJ9B,EAKrB,CADkB,CACwB,AAFmB,EAEnB,CAAjCC,AAAiC,CAAA,AAFnC,GACmB,CAC8C,GAExE,EAGEI,EAEK,CAJLF,AAIK,CAAA,AAPgBD,MAKP,CAGhB,EAIgB,EACT,AAb2B,CAa3B,AAJLI,CAIK,AAVS,CAIT,CAHLF,CASK,GAbmC,CAc1C,CALW,CAFuB,AAOI,CAHpCG,CAGoC,CAA7BE,AA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MrC,EAAM,GAAK,CAAC,MAAEqC,QAAMrC,EAAM,CAAC,EACvCwD,IAAI,CAAC,CAACC,EAAGC,IAAMA,EAAE1D,KAAK,CAAGyD,EAAEzD,KAAK,CACrC,mBARO,SAASgD,AAAaX,CAAY,CAAEY,CAAU,EACnDH,EAAQtB,GAAG,CAACa,EAAMa,KAAKC,KAAK,CAACF,GAC/B","ignoreList":[1]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../app/api/health/route.ts","../../../node_modules/next/src/build/templates/app-route.ts"],"sourcesContent":["export async function GET() {\n return Response.json({\n status: 'ok',\n timestamp: new Date().toISOString(),\n version: '1.0.0'\n });\n }","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport {\n addRequestMeta,\n getRequestMeta,\n setRequestMeta,\n type RequestMeta,\n} from '../../server/request-meta'\nimport {\n getTracer,\n type Span,\n SpanKind,\n SpanStatusCode,\n} from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport { isRouteCacheOwner } from '../../server/lib/route-cache-key'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n // The lazy require factory ensures that:\n // - In dev: devRequestTimingInternalsEnd is set before userland executes,\n // correctly attributing module load time to application-code rather than\n // framework internals.\n // - In all modes: async modules (route files with top-level await) are\n // handled correctly — require() returns a Promise for such modules, which\n // ensureUserland() awaits before the first request is handled.\n userland: () => require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n // In Turbopack dev mode, also provide a synchronous per-request getter so\n // server HMR updates are picked up without re-executing the entry chunk.\n // Using require() (synchronous) avoids adding async overhead that would be\n // incorrectly attributed to application-code time in devRequestTiming.\n ...(process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER\n ? {\n getUserland: () =>\n require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n }\n : {}),\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil?: (prom: Promise<void>) => void\n requestMeta?: RequestMeta\n }\n) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta)\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n deploymentId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n // Only this route's prerenders can establish ISR or admit generated params.\n const isPrerendered =\n Boolean(prerenderManifest.routes[resolvedPathname]) &&\n (routeModule.isDev ||\n isRouteCacheOwner(\n resolvedPathname,\n routeModule.cacheOwner,\n prerenderManifest.routes[resolvedPathname]\n ))\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n const isWrappedByNextServer = Boolean(\n routerServerContext?.isWrappedByNextServer\n )\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n const incrementalCache =\n getRequestMeta(req, 'incrementalCache') ||\n (await routeModule.getIncrementalCache(\n req,\n nextConfig,\n prerenderManifest,\n isMinimalMode\n ))\n\n incrementalCache?.resetRequestCache()\n ;(globalThis as any).__incrementalCache = incrementalCache\n\n const context: AppRouteRouteHandlerContext = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n useCacheTimeout: nextConfig.experimental.useCacheTimeout,\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n validationLevel: nextConfig.experimental.instantInsights.validationLevel,\n isDraftMode,\n supportsDynamicResponse,\n incrementalCache,\n hmrRefreshHash: getRequestMeta(req, 'hmrRefreshHash'),\n cacheLifeProfiles: nextConfig.cacheLife,\n staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n deploymentId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await routeModule.handle(nextReq, context)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? // Fall back to the global `expireTime` config when the\n // route has a numeric `revalidate` but didn't declare an\n // explicit `expire` (e.g. via `cacheLife`). This mirrors the\n // build-time fallback in `build/index.ts` so cache entries\n // and the response Cache-Control header agree on the route's\n // effective expire. Routes that opt out of revalidation\n // (`revalidate: false`) or that are dynamic (`revalidate: 0`)\n // keep `expire: undefined`.\n revalidate !== false && revalidate > 0\n ? nextConfig.expireTime\n : undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, pendingWaitUntil)\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const handleResponse = async (\n currentSpan: Span | undefined,\n parentSpan: Span | undefined\n ) => {\n try {\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return\n } finally {\n ;(() => {\n if (!currentSpan) {\n return\n }\n\n let statusCode = res.statusCode\n\n currentSpan.setAttributes({\n 'http.status_code': statusCode,\n 'next.rsc': false,\n })\n\n if (statusCode && statusCode >= 500) {\n // For 5xx status codes: SHOULD be set to 'Error' span status.\n // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status\n currentSpan.setStatus({\n code: SpanStatusCode.ERROR,\n })\n // For span status 'Error', SHOULD set 'error.type' attribute.\n currentSpan.setAttribute('error.type', statusCode.toString())\n }\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route') || normalizedSrcPage\n const name = `${method} ${route}`\n\n currentSpan.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n currentSpan.updateName(name)\n\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== currentSpan) {\n parentSpan.setAttribute('http.route', route)\n parentSpan.updateName(name)\n }\n })()\n }\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan, undefined)\n } else {\n let parentSpan = tracer.getActiveScopeSpan()\n await tracer.withPropagatedContext(\n req.headers,\n () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n (span) => handleResponse(span, parentSpan)\n ),\n undefined,\n !isWrappedByNextServer\n )\n }\n}\n"],"names":["GET","Response","json","status","timestamp","Date","toISOString","version","AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","setRequestMeta","getTracer","SpanKind","SpanStatusCode","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","isRouteCacheOwner","CachedRouteKind","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","userland","require","TURBOPACK","__NEXT_DEV_SERVER","getUserland","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","req","res","ctx","requestMeta","isDev","hrtime","bigint","srcPage","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","deploymentId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isPrerendered","Boolean","routes","cacheOwner","isIsr","dynamicRoutes","render404","prerenderInfo","fallback","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","isWrappedByNextServer","isMinimalMode","incrementalCache","getIncrementalCache","resetRequestCache","globalThis","__incrementalCache","context","previewProps","preview","renderOpts","experimental","authInterrupts","useCacheTimeout","cacheComponents","validationLevel","instantInsights","hmrRefreshHash","cacheLifeProfiles","cacheLife","staticPageGenerationTimeout","onClose","cb","on","onAfterTaskError","undefined","onInstrumentationRequestError","error","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","responseGenerator","previousCacheEntry","setHeader","response","handle","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","headers","type","revalidate","collectedRevalidate","expire","collectedExpire","expireTime","cacheEntry","value","body","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","handleResponse","currentSpan","parentSpan","routeKind","isFallback","isRoutePPREnabled","Error","isMiss","delete","getHeader","get","set","setAttributes","setStatus","code","ERROR","setAttribute","toString","rootSpanAttributes","getRootSpanAttributes","handleRequest","console","warn","route","name","updateName","withPropagatedContext","trace","spanName","SERVER","attributes","url","span"],"mappings":"+gCAAO,eAAeA,IAClB,OAAOC,SAASC,IAAI,CAAC,CACnBC,OAAQ,KACRC,UAAW,IAAIC,OAAOC,WAAW,GACjCC,QAAS,OACX,EACF,0CCNF,IAAA,EAIO,EAAA,CAHLC,AAGK,CAAA,OACP,EAA0B,EAAyB,CAAA,AAA1CC,CAA0C,GAAA,EAJ9B,EAKrB,CADkB,CACwB,AAFmB,EAEnB,CAAjCC,AAAiC,CAAA,AAFnC,GACmB,CAC8C,GAExE,EAGEI,EAEK,CAJLF,AAIK,CAAA,AAPgBD,MAKP,CAGhB,EAIgB,EACT,AAb2B,CAShCI,AAIK,CAAA,AAVS,CAIT,CAHLF,CASK,GAbmC,CAc1C,CALW,CAFuB,AAOI,CAHpCG,CAGoC,CAA7BE,AAA6B,CAAA,EADA,CATtB,EACdJ,AAMQ,EAIV,AAHEG,EAG+B,EAAA,CAAxBE,AAAwB,CAAA,EADkD,IACT,CAC1E,AAF8B,CAFd,CAI0B,EAAQ,CAAA,AAAzCC,CAAyC,CAAA,CADzB,AADa,KAGtC,EAEEG,CAJ+B,CAC8C,AAIxE,CAFLD,AAEK,CAAA,CAJiB,CAGA,CAHED,IAK1B,EAA+B,CADxB,CAC0D,CAAxDG,AAAwD,CAAA,IAH7C,EAClBD,AAHwC,CAM1C,EAAoC,EAAA,CAA3BE,AAA2B,CADb,AACa,IAD6B,AACO,GACxE,CAF+B,CAEF,EAA4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AcA,EACd,iBAAkBC,CACpB,GACAvB,EAAYwB,UAAU,CAACD,GAInBtB,GAAcA,IAAeD,IAC/BC,EAAWc,OADiC,KACrB,CAAC,aAAcO,GACtCrB,EAAWuB,UAAU,CAACD,IAE1B,CAAA,EACF,CACF,EAIA,GAAI3F,GAAyBF,EAC3B,MAAMqE,EAAerE,EADkB,KACN2B,OAC5B,CACL,IAAI4C,EAAaxE,EAAOE,kBAAkB,EAC1C,OAAMF,EAAOgG,qBAAqB,CAChC9I,EAAIgG,OAAO,CACX,IACElD,EAAOiG,KAAK,CACVnL,EAAAA,cAAAA,CAAe4K,aAAa,CAC5B,CACEQ,SAAU,CAAA,EAAGnG,EAAO,CAAC,EAAEtC,EAAAA,CAAS,CAChC9B,KAAMrB,EAAAA,QAAAA,CAAS6L,MAAM,CACrBC,WAAY,CACV,cAAerG,EACf,cAAe7C,EAAImJ,GAAG,AACxB,CACF,EACA,AAACC,GAAShC,EAAegC,EAAM9B,SAEnC5C,EACA,CAACzB,EAEL,CACF,mCAzgBA,SAASnG,EACP,MAAA,CAAA,EAAOC,EAAAA,UAAAA,EAAY,kBACjB6C,uBACAC,CACF,EACF","ignoreList":[1]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module.exports=[49719,(e,t,r)=>{t.exports=e.x("assert",()=>require("assert"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},27699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},21517,(e,t,r)=>{t.exports=e.x("http",()=>require("http"))},25328,(e,t,r)=>{t.exports=e.x("http2",()=>require("http2"))},24836,(e,t,r)=>{t.exports=e.x("https",()=>require("https"))},4446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},59043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},88947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},55004,(e,t,r)=>{t.exports=e.x("tls",()=>require("tls"))},70722,(e,t,r)=>{t.exports=e.x("tty",()=>require("tty"))},92509,(e,t,r)=>{t.exports=e.x("url",()=>require("url"))},24361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},6461,(e,t,r)=>{t.exports=e.x("zlib",()=>require("zlib"))},23892,e=>{"use strict";var t=e.i(65617);async function r(e,r){if(!r)return a();try{let o,i=(n=e,o=`Analyze these website performance metrics and provide insights:
|
|
2
|
-
|
|
3
|
-
`,n.pages?.forEach(e=>{o+=`
|
|
4
|
-
Page: ${e.name} (${e.url})
|
|
5
|
-
- Load Time: ${e.newRelic?.loadTime}ms
|
|
6
|
-
- Error Rate: ${e.newRelic?.errorRate}%
|
|
7
|
-
- Errors: ${e.sentry?.errorCount} errors
|
|
8
|
-
|
|
9
|
-
`}),o+=`
|
|
10
|
-
Please provide:
|
|
11
|
-
1. Which pages have performance issues?
|
|
12
|
-
2. Are there correlations between errors and load time?
|
|
13
|
-
3. What are the top 3 recommendations for improvement?
|
|
14
|
-
4. Which pages need immediate attention?
|
|
15
|
-
|
|
16
|
-
Respond with ONLY raw JSON (no markdown fences) with keys: analysis, alerts, recommendations.
|
|
17
|
-
Each alert must have: severity ("high"|"medium"|"low"), page, message, metric.
|
|
18
|
-
"metric" must be a SHORT single label naming which metric triggered the alert
|
|
19
|
-
(e.g. "loadTime", "lcp", "ttfb", "errorRate", "errorCount", "apdexScore") —
|
|
20
|
-
never a sentence or multiple values.`),l=await t.default.post(`https://generativelanguage.googleapis.com/v1beta/models/gemini-flash-lite-latest:generateContent?key=${r}`,{contents:[{parts:[{text:i}]}],generationConfig:{maxOutputTokens:512}},{headers:{"content-type":"application/json"}});var n,s=l.data?.candidates?.[0]?.content?.parts?.[0]?.text??"";try{let e=s.match(/\{[\s\S]*\}/);if(e)return JSON.parse(e[0])}catch(e){console.error("Error parsing Gemini response:",e)}return a()}catch(e){return console.error("Gemini API error:",e),a()}}function a(){return{analysis:"Home page is loading slower than expected with 5 errors. Dashboard has better performance but shows network issues.",alerts:[{severity:"high",page:"/",message:"Home page load time is 1200ms (threshold: 1000ms)",metric:"loadTime"},{severity:"medium",page:"/dashboard",message:"Dashboard has 2 network errors",metric:"errorCount"}],recommendations:["Optimize images on home page - they account for 40% of load time","Implement lazy loading for below-the-fold content","Cache API responses to reduce network calls","Review error handling in dashboard network requests"]}}var n=e.i(90770);async function s(e){try{let t=await e.json(),a=performance.now(),s=await r(t.metrics,process.env.GEMINI_API_KEY??"");return(0,n.recordTiming)("Gemini: analyze",performance.now()-a),Response.json(s)}catch(e){return console.error("Analysis API error:",e),Response.json({error:e instanceof Error?e.message:"Unknown error"},{status:500})}}e.s(["POST",0,s],23892)},78143,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),p=e.i(95169),d=e.i(47587),c=e.i(66012),h=e.i(70101),m=e.i(26937),x=e.i(10372),g=e.i(93695),v=e.i(9580);e.i(52474);var R=e.i(220);let f=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/analyze/route",pathname:"/api/analyze",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/analyze/route.ts",nextConfigOutput:"",userland:()=>e.r(23892),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:y,serverHooks:E}=f;async function C(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),f.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/analyze/route";w=w.replace(/\/index$/,"")||"/";let y=await f.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:C,params:b,nextConfig:q,parsedUrl:A,isDraftMode:T,prerenderManifest:P,routerServerContext:S,isOnDemandRevalidate:O,revalidateOnlyGenerated:k,resolvedPathname:N,clientReferenceManifest:I,serverActionsManifest:_}=y,H=(0,i.normalizeAppPath)(w),j=!!P.routes[N]&&(f.isDev||(0,v.isRouteCacheOwner)(N,f.cacheOwner,P.routes[N])),M=!!(P.dynamicRoutes[H]||j),D=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,A,!1):t.end("This page could not be found"),null);if(M&&!T){let e=P.dynamicRoutes[H];if(e&&!1===e.fallback&&!j){if(q.adapterPath)return await D();throw new g.NoFallbackError}}let U=null;!M||f.isDev||T||(U="/index"===(U=N)?"/":U);let $=!0===f.isDev||!M,z=M&&!$;_&&I&&(0,o.setManifestsSingleton)({page:w,clientReferenceManifest:I,serverActionsManifest:_});let G=e.method||"GET",K=(0,s.getTracer)(),L=K.getActiveScopeSpan(),F=!!(null==S?void 0:S.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),W=(0,n.getRequestMeta)(e,"incrementalCache")||await f.getIncrementalCache(e,q,P,B);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let V={params:b,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!q.experimental.authInterrupts,useCacheTimeout:q.experimental.useCacheTimeout},cacheComponents:!!q.cacheComponents,validationLevel:q.experimental.instantInsights.validationLevel,isDraftMode:T,supportsDynamicResponse:$,incrementalCache:W,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:q.cacheLife,staticPageGenerationTimeout:q.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>f.onRequestError(e,t,a,n,S)},sharedContext:{buildId:E,deploymentId:C}},X=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),Y=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:r})=>{try{if(!B&&O&&k&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await f.handle(Y,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let s=V.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let o=V.renderOpts.collectedTags;if(!M)return await (0,c.sendResponse)(X,J,n,s),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);o&&(t[x.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=x.INFINITE_CACHE?!1!==r&&r>0?q.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await f.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:z,isOnDemandRevalidate:O})},!1,S),t}},Q=async(n,o)=>{try{var i,l;let n=await f.handleResponse({req:e,nextConfig:q,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:k,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:B});if(!M)return;if((null==n||null==(i=n.value)?void 0:i.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",O?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);B&&M||s.delete(x.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,m.getCacheControlHeader)(n.cacheControl)),await (0,c.sendResponse)(X,J,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof g.NoFallbackError||await f.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:z,isOnDemandRevalidate:O})},!1,S),M)throw t;await (0,c.sendResponse)(X,J,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||H,i=`${G} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":i}),n.updateName(i),o&&o!==n&&(o.setAttribute("http.route",a),o.updateName(i))})()}};if(F&&L)await Q(L,void 0);else{let t=K.getActiveScopeSpan();await K.withPropagatedContext(e.headers,()=>K.trace(p.BaseServerSpan.handleRequest,{spanName:`${G} ${w}`,kind:s.SpanKind.SERVER,attributes:{"http.method":G,"http.target":e.url}},e=>Q(e,t)),void 0,!F)}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:y})},"routeModule",0,f,"serverHooks",0,E,"workAsyncStorage",0,w,"workUnitAsyncStorage",0,y])},90770,e=>{"use strict";let t=new Map;e.s(["getTimings",0,function(){return Array.from(t.entries()).map(([e,t])=>({name:e,value:t})).sort((e,t)=>t.value-e.value)},"recordTiming",0,function(e,r){t.set(e,Math.round(r))}])}];
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__1i_tsds._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/aiAnalysis.ts","../../../app/api/analyze/route.ts","../../../node_modules/next/src/build/templates/app-route.ts","../../../lib/apiTimingStore.ts"],"sourcesContent":["import axios from 'axios';\n\n// flash-lite: Gemini's cheapest/lowest-latency tier, and \"-latest\" tracks\n// the current version instead of a dated name that Google later retires.\nconst GEMINI_API_URL = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-flash-lite-latest:generateContent';\n\ninterface PageMetrics {\n name: string;\n url: string;\n newRelic?: { loadTime?: number; errorRate?: number };\n sentry?: { errorCount?: number };\n}\n\ninterface Metrics {\n pages?: PageMetrics[];\n}\n\nexport async function analyzeMetrics(metrics: Metrics, apiKey: string) {\n if (!apiKey) {\n return getMockAnalysis();\n }\n\n try {\n const prompt = formatMetricsForPrompt(metrics);\n\n const response = await axios.post(\n `${GEMINI_API_URL}?key=${apiKey}`,\n {\n contents: [{ parts: [{ text: prompt }] }],\n generationConfig: { maxOutputTokens: 512 }\n },\n {\n headers: { 'content-type': 'application/json' }\n }\n );\n\n const text: string = response.data?.candidates?.[0]?.content?.parts?.[0]?.text ?? '';\n return parseAnalysisResponse(text);\n } catch (error) {\n console.error('Gemini API error:', error);\n return getMockAnalysis();\n }\n}\n\nfunction formatMetricsForPrompt(metrics: Metrics) {\n let prompt = `Analyze these website performance metrics and provide insights:\n\n`;\n\n metrics.pages?.forEach((page: PageMetrics) => {\n prompt += `\nPage: ${page.name} (${page.url})\n- Load Time: ${page.newRelic?.loadTime}ms\n- Error Rate: ${page.newRelic?.errorRate}%\n- Errors: ${page.sentry?.errorCount} errors\n\n`;\n });\n\n prompt += `\nPlease provide:\n1. Which pages have performance issues?\n2. Are there correlations between errors and load time?\n3. What are the top 3 recommendations for improvement?\n4. Which pages need immediate attention?\n\nRespond with ONLY raw JSON (no markdown fences) with keys: analysis, alerts, recommendations.\nEach alert must have: severity (\"high\"|\"medium\"|\"low\"), page, message, metric.\n\"metric\" must be a SHORT single label naming which metric triggered the alert\n(e.g. \"loadTime\", \"lcp\", \"ttfb\", \"errorRate\", \"errorCount\", \"apdexScore\") —\nnever a sentence or multiple values.`;\n\n return prompt;\n}\n\nfunction parseAnalysisResponse(text: string) {\n try {\n const jsonMatch = text.match(/\\{[\\s\\S]*\\}/);\n if (jsonMatch) {\n return JSON.parse(jsonMatch[0]);\n }\n } catch (error) {\n console.error('Error parsing Gemini response:', error);\n }\n\n return getMockAnalysis();\n}\n\nfunction getMockAnalysis() {\n return {\n analysis: 'Home page is loading slower than expected with 5 errors. Dashboard has better performance but shows network issues.',\n alerts: [\n {\n severity: 'high',\n page: '/',\n message: 'Home page load time is 1200ms (threshold: 1000ms)',\n metric: 'loadTime'\n },\n {\n severity: 'medium',\n page: '/dashboard',\n message: 'Dashboard has 2 network errors',\n metric: 'errorCount'\n }\n ],\n recommendations: [\n 'Optimize images on home page - they account for 40% of load time',\n 'Implement lazy loading for below-the-fold content',\n 'Cache API responses to reduce network calls',\n 'Review error handling in dashboard network requests'\n ]\n };\n}\n","import { analyzeMetrics } from '@/lib/aiAnalysis';\nimport { recordTiming } from '@/lib/apiTimingStore';\n\nexport async function POST(request: Request) {\n try {\n const data = await request.json();\n\n const geminiStart = performance.now();\n const analysis = await analyzeMetrics(\n data.metrics,\n process.env.GEMINI_API_KEY ?? ''\n );\n recordTiming('Gemini: analyze', performance.now() - geminiStart);\n\n return Response.json(analysis);\n } catch (error) {\n console.error('Analysis API error:', error);\n return Response.json(\n { error: error instanceof Error ? error.message : 'Unknown error' },\n { status: 500 }\n );\n }\n}","import {\n AppRouteRouteModule,\n type AppRouteRouteHandlerContext,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport {\n addRequestMeta,\n getRequestMeta,\n setRequestMeta,\n type RequestMeta,\n} from '../../server/request-meta'\nimport {\n getTracer,\n type Span,\n SpanKind,\n SpanStatusCode,\n} from '../../server/lib/trace/tracer'\nimport { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node'\nimport {\n NextRequestAdapter,\n signalFromNodeResponse,\n} from '../../server/web/spec-extension/adapters/next-request'\nimport { BaseServerSpan } from '../../server/lib/trace/constants'\nimport { getRevalidateReason } from '../../server/instrumentation/utils'\nimport { sendResponse } from '../../server/send-response'\nimport {\n fromNodeOutgoingHttpHeaders,\n toNodeOutgoingHttpHeaders,\n} from '../../server/web/utils'\nimport { getCacheControlHeader } from '../../server/lib/cache-control'\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from '../../lib/constants'\nimport { NoFallbackError } from '../../shared/lib/no-fallback-error.external'\nimport { isRouteCacheOwner } from '../../server/lib/route-cache-key'\nimport {\n CachedRouteKind,\n type ResponseCacheEntry,\n type ResponseGenerator,\n} from '../../server/response-cache'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n // The lazy require factory ensures that:\n // - In dev: devRequestTimingInternalsEnd is set before userland executes,\n // correctly attributing module load time to application-code rather than\n // framework internals.\n // - In all modes: async modules (route files with top-level await) are\n // handled correctly — require() returns a Promise for such modules, which\n // ensureUserland() awaits before the first request is handled.\n userland: () => require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n // In Turbopack dev mode, also provide a synchronous per-request getter so\n // server HMR updates are picked up without re-executing the entry chunk.\n // Using require() (synchronous) avoids adding async overhead that would be\n // incorrectly attributed to application-code time in devRequestTiming.\n ...(process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER\n ? {\n getUserland: () =>\n require('VAR_USERLAND') as typeof import('VAR_USERLAND'),\n }\n : {}),\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n\nexport async function handler(\n req: IncomingMessage,\n res: ServerResponse,\n ctx: {\n waitUntil?: (prom: Promise<void>) => void\n requestMeta?: RequestMeta\n }\n) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta)\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint())\n }\n let srcPage = 'VAR_DEFINITION_PAGE'\n\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/'\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/'\n }\n const multiZoneDraftMode = process.env\n .__NEXT_MULTI_ZONE_DRAFT_MODE as any as boolean\n\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode,\n })\n\n if (!prepareResult) {\n res.statusCode = 400\n res.end('Bad Request')\n ctx.waitUntil?.(Promise.resolve())\n return null\n }\n\n const {\n buildId,\n deploymentId,\n params,\n nextConfig,\n parsedUrl,\n isDraftMode,\n prerenderManifest,\n routerServerContext,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n resolvedPathname,\n clientReferenceManifest,\n serverActionsManifest,\n } = prepareResult\n\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n // Only this route's prerenders can establish ISR or admit generated params.\n const isPrerendered =\n Boolean(prerenderManifest.routes[resolvedPathname]) &&\n (routeModule.isDev ||\n isRouteCacheOwner(\n resolvedPathname,\n routeModule.cacheOwner,\n prerenderManifest.routes[resolvedPathname]\n ))\n\n let isIsr = Boolean(\n prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered\n )\n\n const render404 = async () => {\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext?.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false)\n } else {\n res.end('This page could not be found')\n }\n return null\n }\n\n if (isIsr && !isDraftMode) {\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]\n\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404()\n }\n throw new NoFallbackError()\n }\n }\n }\n\n let cacheKey: string | null = null\n\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey\n }\n\n const supportsDynamicResponse: boolean =\n // If we're in development, we always support dynamic HTML\n routeModule.isDev === true ||\n // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr\n\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse\n\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest,\n })\n }\n\n const method = req.method || 'GET'\n const tracer = getTracer()\n const activeSpan = tracer.getActiveScopeSpan()\n const isWrappedByNextServer = Boolean(\n routerServerContext?.isWrappedByNextServer\n )\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'))\n\n const incrementalCache =\n getRequestMeta(req, 'incrementalCache') ||\n (await routeModule.getIncrementalCache(\n req,\n nextConfig,\n prerenderManifest,\n isMinimalMode\n ))\n\n incrementalCache?.resetRequestCache()\n ;(globalThis as any).__incrementalCache = incrementalCache\n\n const context: AppRouteRouteHandlerContext = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts),\n useCacheTimeout: nextConfig.experimental.useCacheTimeout,\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n validationLevel: nextConfig.experimental.instantInsights.validationLevel,\n isDraftMode,\n supportsDynamicResponse,\n incrementalCache,\n hmrRefreshHash: getRequestMeta(req, 'hmrRefreshHash'),\n cacheLifeProfiles: nextConfig.cacheLife,\n staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,\n waitUntil: ctx.waitUntil,\n onClose: (cb) => {\n res.on('close', cb)\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (\n error,\n _request,\n errorContext,\n silenceLog\n ) =>\n routeModule.onRequestError(\n req,\n error,\n errorContext,\n silenceLog,\n routerServerContext\n ),\n },\n sharedContext: {\n buildId,\n deploymentId,\n },\n }\n const nodeNextReq = new NodeNextRequest(req)\n const nodeNextRes = new NodeNextResponse(res)\n\n const nextReq = NextRequestAdapter.fromNodeNextRequest(\n nodeNextReq,\n signalFromNodeResponse(res)\n )\n\n const responseGenerator: ResponseGenerator = async ({\n previousCacheEntry,\n }) => {\n try {\n if (\n !isMinimalMode &&\n isOnDemandRevalidate &&\n revalidateOnlyGenerated &&\n !previousCacheEntry\n ) {\n res.statusCode = 404\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED')\n res.end('This page could not be found')\n return null\n }\n\n const response = await routeModule.handle(nextReq, context)\n\n ;(req as any).fetchMetrics = (context.renderOpts as any).fetchMetrics\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil\n\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil)\n pendingWaitUntil = undefined\n }\n }\n const cacheTags = context.renderOpts.collectedTags\n\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob()\n\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers)\n\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags\n }\n\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type\n }\n\n const revalidate =\n typeof context.renderOpts.collectedRevalidate === 'undefined' ||\n context.renderOpts.collectedRevalidate >= INFINITE_CACHE\n ? false\n : context.renderOpts.collectedRevalidate\n\n const expire =\n typeof context.renderOpts.collectedExpire === 'undefined' ||\n context.renderOpts.collectedExpire >= INFINITE_CACHE\n ? // Fall back to the global `expireTime` config when the\n // route has a numeric `revalidate` but didn't declare an\n // explicit `expire` (e.g. via `cacheLife`). This mirrors the\n // build-time fallback in `build/index.ts` so cache entries\n // and the response Cache-Control header agree on the route's\n // effective expire. Routes that opt out of revalidation\n // (`revalidate: false`) or that are dynamic (`revalidate: 0`)\n // keep `expire: undefined`.\n revalidate !== false && revalidate > 0\n ? nextConfig.expireTime\n : undefined\n : context.renderOpts.collectedExpire\n\n // Create the cache entry for the response.\n const cacheEntry: ResponseCacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers,\n },\n cacheControl: { revalidate, expire },\n }\n\n return cacheEntry\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, pendingWaitUntil)\n return null\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry?.isStale) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n throw err\n }\n }\n\n const handleResponse = async (\n currentSpan: Span | undefined,\n parentSpan: Span | undefined\n ) => {\n try {\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode,\n })\n\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return\n }\n\n if (cacheEntry?.value?.kind !== CachedRouteKind.APP_ROUTE) {\n throw new Error(\n `Invariant: app-route received invalid cache entry ${cacheEntry?.value?.kind}`\n )\n }\n\n if (!isMinimalMode) {\n res.setHeader(\n 'x-nextjs-cache',\n isOnDemandRevalidate\n ? 'REVALIDATED'\n : cacheEntry.isMiss\n ? 'MISS'\n : cacheEntry.isStale\n ? 'STALE'\n : 'HIT'\n )\n }\n\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader(\n 'Cache-Control',\n 'private, no-cache, no-store, max-age=0, must-revalidate'\n )\n }\n\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers)\n\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER)\n }\n\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (\n cacheEntry.cacheControl &&\n !res.getHeader('Cache-Control') &&\n !headers.get('Cache-Control')\n ) {\n headers.set(\n 'Cache-Control',\n getCacheControlHeader(cacheEntry.cacheControl)\n )\n }\n\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200,\n })\n )\n return\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false\n await routeModule.onRequestError(\n req,\n err,\n {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate,\n }),\n },\n silenceLog,\n routerServerContext\n )\n }\n\n // rethrow so that we can handle serving error page\n\n // If this is during static generation, throw the error again.\n if (isIsr) throw err\n\n // Otherwise, send a 500 response.\n await sendResponse(\n nodeNextReq,\n nodeNextRes,\n new Response(null, { status: 500 })\n )\n return\n } finally {\n ;(() => {\n if (!currentSpan) {\n return\n }\n\n let statusCode = res.statusCode\n\n currentSpan.setAttributes({\n 'http.status_code': statusCode,\n 'next.rsc': false,\n })\n\n if (statusCode && statusCode >= 500) {\n // For 5xx status codes: SHOULD be set to 'Error' span status.\n // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status\n currentSpan.setStatus({\n code: SpanStatusCode.ERROR,\n })\n // For span status 'Error', SHOULD set 'error.type' attribute.\n currentSpan.setAttribute('error.type', statusCode.toString())\n }\n\n const rootSpanAttributes = tracer.getRootSpanAttributes()\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return\n }\n\n if (\n rootSpanAttributes.get('next.span_type') !==\n BaseServerSpan.handleRequest\n ) {\n console.warn(\n `Unexpected root span type '${rootSpanAttributes.get(\n 'next.span_type'\n )}'. Please report this Next.js issue https://github.com/vercel/next.js`\n )\n return\n }\n\n const route = rootSpanAttributes.get('next.route') || normalizedSrcPage\n const name = `${method} ${route}`\n\n currentSpan.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name,\n })\n currentSpan.updateName(name)\n\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== currentSpan) {\n parentSpan.setAttribute('http.route', route)\n parentSpan.updateName(name)\n }\n })()\n }\n }\n\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan, undefined)\n } else {\n let parentSpan = tracer.getActiveScopeSpan()\n await tracer.withPropagatedContext(\n req.headers,\n () =>\n tracer.trace(\n BaseServerSpan.handleRequest,\n {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url,\n },\n },\n (span) => handleResponse(span, parentSpan)\n ),\n undefined,\n !isWrappedByNextServer\n )\n }\n}\n","import type { TrafficBarItem } from '@/types';\n\n/**\n * Holds the most recent measured duration of each named external API call\n * (New Relic, Sentry per-page, Gemini), recorded by the route handlers\n * that actually make those calls. Powers the \"Rankings Moved\" card, which\n * shows real call latency ranked slowest-first instead of SEO data (no\n * connected platform has ranking data — this does the same \"ranked bars\"\n * job with something we actually measure).\n *\n * ponytail: in-memory, single-process — resets on dev server restart and\n * isn't shared across serverless instances. Fine for local dev; upgrade\n * to a real store if this needs to survive restarts or aggregate across\n * instances.\n */\nconst timings = new Map<string, number>();\n\nexport function recordTiming(name: string, ms: number) {\n timings.set(name, Math.round(ms));\n}\n\nexport function getTimings(): TrafficBarItem[] {\n return Array.from(timings.entries())\n .map(([name, value]) => ({ name, value }))\n .sort((a, b) => b.value - a.value);\n}\n"],"names":["GEMINI_API_URL","analyzeMetrics","metrics","apiKey","getMockAnalysis","prompt","formatMetricsForPrompt","response","post","contents","parts","text","generationConfig","maxOutputTokens","headers","data","candidates","content","parseAnalysisResponse","error","console","pages","forEach","page","name","url","newRelic","loadTime","errorRate","sentry","errorCount","jsonMatch","match","JSON","parse","analysis","alerts","severity","message","metric","recommendations","AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","addRequestMeta","getRequestMeta","setRequestMeta","getTracer","SpanKind","SpanStatusCode","setManifestsSingleton","normalizeAppPath","NodeNextRequest","NodeNextResponse","NextRequestAdapter","signalFromNodeResponse","BaseServerSpan","getRevalidateReason","sendResponse","fromNodeOutgoingHttpHeaders","toNodeOutgoingHttpHeaders","getCacheControlHeader","INFINITE_CACHE","NEXT_CACHE_TAGS_HEADER","NoFallbackError","isRouteCacheOwner","CachedRouteKind","routeModule","definition","kind","APP_ROUTE","pathname","filename","bundlePath","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","resolvedPagePath","nextConfigOutput","userland","require","TURBOPACK","__NEXT_DEV_SERVER","getUserland","workAsyncStorage","workUnitAsyncStorage","serverHooks","handler","req","res","ctx","requestMeta","isDev","hrtime","bigint","srcPage","replace","multiZoneDraftMode","__NEXT_MULTI_ZONE_DRAFT_MODE","prepareResult","prepare","statusCode","end","waitUntil","Promise","resolve","buildId","deploymentId","params","nextConfig","parsedUrl","isDraftMode","prerenderManifest","routerServerContext","isOnDemandRevalidate","revalidateOnlyGenerated","resolvedPathname","clientReferenceManifest","serverActionsManifest","normalizedSrcPage","isPrerendered","Boolean","routes","cacheOwner","isIsr","dynamicRoutes","render404","prerenderInfo","fallback","adapterPath","cacheKey","supportsDynamicResponse","isStaticGeneration","method","tracer","activeSpan","getActiveScopeSpan","isWrappedByNextServer","isMinimalMode","incrementalCache","getIncrementalCache","resetRequestCache","globalThis","__incrementalCache","context","previewProps","preview","renderOpts","experimental","authInterrupts","useCacheTimeout","cacheComponents","validationLevel","instantInsights","hmrRefreshHash","cacheLifeProfiles","cacheLife","staticPageGenerationTimeout","onClose","cb","on","onAfterTaskError","undefined","onInstrumentationRequestError","_request","errorContext","silenceLog","onRequestError","sharedContext","nodeNextReq","nodeNextRes","nextReq","fromNodeNextRequest","responseGenerator","previousCacheEntry","setHeader","handle","fetchMetrics","pendingWaitUntil","cacheTags","collectedTags","blob","type","revalidate","collectedRevalidate","expire","collectedExpire","expireTime","cacheEntry","value","status","body","Buffer","from","arrayBuffer","cacheControl","err","isStale","routerKind","routePath","routeType","revalidateReason","handleResponse","currentSpan","parentSpan","routeKind","isFallback","isRoutePPREnabled","Error","isMiss","delete","getHeader","get","set","Response","setAttributes","setStatus","code","ERROR","setAttribute","toString","rootSpanAttributes","getRootSpanAttributes","handleRequest","warn","route","updateName","withPropagatedContext","trace","spanName","SERVER","attributes","span","timings","Map","recordTiming","ms","Math","round","getTimings","Array","entries","map","sort","a","b"],"mappings":"u0DAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAiBO,eAAeC,EAAeC,CAAgB,CAAEC,CAAc,EACnE,GAAI,CAACA,EACH,MADW,CACJC,IAGT,GAAI,OACIC,GAqBsBH,EArBUA,EAsBpCG,EAtBaC,AAsBJ,CADiC,AAChC;;AAEhB,CAAC,CAECJ,EAA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AcU,EACd,aAAcA,EACd,iBAAkB7M,CACpB,GACAuL,EAAYuB,UAAU,CAAC9M,GAInBwL,GAAcA,IAAeD,IAC/BC,EAAWe,OADiC,KACrB,CAAC,aAAcM,GACtCrB,EAAWsB,UAAU,CAAC9M,IAE1B,CAAA,EACF,CACF,EAIA,GAAIqH,GAAyBF,EAC3B,MAAMmE,EAAenE,EADkB,KACN2B,OAC5B,CACL,IAAI0C,EAAatE,EAAOE,kBAAkB,EAC1C,OAAMF,EAAO6F,qBAAqB,CAChC3I,EAAI9E,OAAO,CACX,IACE4H,EAAO8F,KAAK,CACV/K,EAAAA,cAAAA,CAAe0K,aAAa,CAC5B,CACEM,SAAU,CAAA,EAAGhG,EAAO,CAAC,EAAEtC,EAAAA,CAAS,CAChC7B,KAAMrB,EAAAA,QAAAA,CAASyL,MAAM,CACrBC,WAAY,CACV,cAAelG,EACf,cAAe7C,EAAInE,GAAG,AACxB,CACF,EACA,AAACmN,GAAS9B,EAAe8B,EAAM5B,SAEnC1C,EACA,CAACzB,EAEL,CACF,mCAzgBA,SAASlG,EACP,MAAA,CAAA,EAAOC,EAAAA,UAAAA,EAAY,kBACjB4C,uBACAC,CACF,EACF,kHChFA,IAAMoJ,EAAU,IAAIC,wBAMb,SAASK,EACd,OAAOC,MAAM/C,IAAI,CAACwC,EAAQQ,OAAO,IAC9BC,GAAG,CAAC,CAAC,CAAC9N,EAAMyK,EAAM,GAAK,CAAC,MAAEzK,QAAMyK,EAAM,CAAC,EACvCsD,IAAI,CAAC,CAACC,EAAGC,IAAMA,EAAExD,KAAK,CAAGuD,EAAEvD,KAAK,CACrC,mBARO,SAAsBzK,AAAbuN,CAAyB,CAAEC,CAAU,EACnDH,EAAQpB,GAAG,CAACjM,EAAMyN,KAAKC,KAAK,CAACF,GAC/B","ignoreList":[2]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/env.ts","../../../lib/localRequest.ts"],"sourcesContent":["import { existsSync, readFileSync, renameSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/** Key name -> label shown on /setup. Order = form order. */\nexport const SETUP_KEYS = [\n 'NEWRELIC_API_KEY',\n 'NEXT_PUBLIC_NEWRELIC_ACCOUNT_ID',\n 'SENTRY_API_KEY',\n 'SENTRY_ORG_SLUG',\n 'SENTRY_PROJECT_ID'\n] as const;\nexport type SetupKey = (typeof SETUP_KEYS)[number];\n/** Sends events from your site (Ingest - License key). Not needed to read data; set on /connect. */\nexport const INSERT_KEY = 'NEWRELIC_INSERT_KEY';\n\n/**\n * Computed-key read: Next inlines literal `process.env.NEXT_PUBLIC_*` at build\n * time, which would freeze the account id before /setup could write it.\n */\nexport function env(name: string): string {\n return process.env[name] ?? '';\n}\n\nexport function isConfigured(): boolean {\n return SETUP_KEYS.every(k => env(k));\n}\n\n/** METRICFLOW_ENV_FILE overrides the target (used by tests so they never touch a real .env.local). */\nexport function envFilePath(): string {\n return process.env.METRICFLOW_ENV_FILE || join(process.cwd(), '.env.local');\n}\n\n/** Merges `values` into .env.local, keeping unrelated lines, and updates process.env so no restart is needed. */\nexport function writeEnvLocal(values: Partial<Record<SetupKey | typeof INSERT_KEY, string>>, path = envFilePath()): void {\n const existing = existsSync(path) ? readFileSync(path, 'utf8').split('\\n') : [];\n const pending = new Map(Object.entries(values));\n const lines = existing.map(line => {\n const name = line.match(/^\\s*([A-Z0-9_]+)\\s*=/)?.[1];\n if (name && pending.has(name)) {\n const v = pending.get(name)!;\n pending.delete(name);\n return `${name}=${v}`;\n }\n return line;\n });\n while (lines.length && lines[lines.length - 1] === '') lines.pop();\n for (const [name, v] of pending) lines.push(`${name}=${v}`);\n\n const tmp = `${path}.tmp`;\n writeFileSync(tmp, lines.join('\\n') + '\\n', { mode: 0o600 });\n renameSync(tmp, path);\n for (const [name, v] of Object.entries(values)) process.env[name] = v;\n}\n","const LOCAL_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]']);\n\nconst LOOPBACK_IPS = new Set(['127.0.0.1', '::1', '::ffff:127.0.0.1']);\n\n/** Set by the CLI when started with a non-loopback --host: the 127.0.0.1 bind no longer protects us. */\nexport const isExposed = () => process.env.METRICFLOW_EXPOSED === '1';\n\nexport const REFUSAL_MESSAGE = () =>\n isExposed()\n ? 'Setup and Connect are disabled because the dashboard is exposed on the network (--host). Restart without --host to use them.'\n : 'Setup is only available from localhost.';\n\n/** Setup writes secrets to disk, so it only answers requests addressed to this machine. */\nexport function isLocalRequest(request: Request): boolean {\n if (isExposed()) return false;\n // Next sets x-forwarded-for to the socket address itself, so only a non-loopback hop means a real proxy.\n const forwarded = request.headers.get('x-forwarded-for');\n if (forwarded && !forwarded.split(',').every(ip => LOOPBACK_IPS.has(ip.trim().replace(/^\\[|\\]$/g, '')))) return false;\n const host = (request.headers.get('host') ?? '').replace(/:\\d+$/, '');\n if (!LOCAL_HOSTS.has(host)) return false;\n const origin = request.headers.get('origin');\n try {\n return !origin || LOCAL_HOSTS.has(new URL(origin).hostname);\n } catch {\n return false;\n }\n}\n"],"names":["SETUP_KEYS","INSERT_KEY","env","name","process","isConfigured","every","k","envFilePath","METRICFLOW_ENV_FILE","cwd","writeEnvLocal","values","path","existing","split","pending","Map","Object","entries","lines","map","line","match","has","v","get","delete","length","pop","push","tmp","join","mode","LOCAL_HOSTS","Set","LOOPBACK_IPS","isExposed","METRICFLOW_EXPOSED","REFUSAL_MESSAGE","isLocalRequest","request","forwarded","headers","ip","trim","replace","host","origin","URL","hostname"],"mappings":"48DAAA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OAGO,IAAMA,EAAa,CACxB,mBACA,kCACA,iBACA,kBACA,oBACD,CASM,SAASE,EAAIC,CAAY,EAC9B,OAAOC,QAAQF,GAAG,CAACC,EAAK,EAAI,EAC9B,qBAR0B,kEAUnB,SAASE,EACd,OAAOL,EAAWM,KAAK,CAACC,GAAKL,EAAIK,GACnC,oBAQO,SAASI,AAAcC,CAA6D,CAAEC,EAJpFT,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