wiki-viewer 1.9.0 → 1.10.1
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/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +3 -0
- package/.next/standalone/.next/build-manifest.json +5 -5
- package/.next/standalone/.next/routes-manifest.json +22 -0
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/agents/[agentId]/revoke/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/agents/[agentId]/revoke/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/agents/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js +3 -4
- package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js +10 -11
- package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js +4 -5
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js +3 -4
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/internal/span/route.js +3 -4
- package/.next/standalone/.next/server/app/api/agent/internal/span/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js +3 -4
- package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/[...all]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/[...all]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/[token]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/share/[token]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/share/[token]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/share/[token]/route.js +14 -0
- package/.next/standalone/.next/server/app/api/share/[token]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/share/[token]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/share/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/share/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/share/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/share/route.js +14 -0
- package/.next/standalone/.next/server/app/api/share/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/share/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/system/browse/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/clear-root/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/root-status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/set-root/route.js +2 -2
- package/.next/standalone/.next/server/app/api/system/set-root/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js +1 -1
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page.js +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/s/[token]/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/s/[token]/page/build-manifest.json +16 -0
- package/.next/standalone/.next/server/app/s/[token]/page/next-font-manifest.json +10 -0
- package/.next/standalone/.next/server/app/s/[token]/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/s/[token]/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/s/[token]/page.js +14 -0
- package/.next/standalone/.next/server/app/s/[token]/page.js.map +5 -0
- package/.next/standalone/.next/server/app/s/[token]/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/s/[token]/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/signin/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/signin/page.js +2 -2
- package/.next/standalone/.next/server/app/signin/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/chunks/0dti_kysely_dist_esm_0u.fq2l._.js +1 -1
- package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0d2jbo5.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01hp8ax._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02scxiu._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07nnfjx._.js +16 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12q8ch8._.js → [root-of-the-server]__08n~vj1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09s9qkd._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12ee_s6._.js → [root-of-the-server]__0bfl4v7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0n3i3vu._.js +16 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ncjv3e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s8ovh5._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0~.-3yk._.js → [root-of-the-server]__0x3m4up._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yzle76._.js +20 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z.pwwj._.js +20 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zgb.q2._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__00qu86p._.js → [root-of-the-server]__0zq0rlw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-inabx._.js → [root-of-the-server]__12y5z5j._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_share_[token]_route_actions_0~m-o26.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_share_route_actions_0gz4h.j.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules__pnpm_0aj5g-w._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_auth_admin_ts_0g4i6v_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/08s9_dagre-d3-es_src_dagre_index_0iwjukf.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0p91_next_dist_esm_build_templates_app-page_0p1dt3f.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{0~w0_katex_dist_katex_mjs_0hyln.b._.js → 0~w0_katex_dist_katex_mjs_03gdxkb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_diagram-OG6HWLK6_mjs_0t5sus6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_erDiagram-TEJ5UH35_mjs_0v6rnqy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_sankeyDiagram-5OEKKPKP_mjs_11ifrnu._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_mermaid_core_mjs_0hj_n-~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00lk0r~._.js → [root-of-the-server]__06mzg2t._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oh...2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0osa2xb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__02twzph._.js → [root-of-the-server]__0xwdc44._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0du58sw._.js → [root-of-the-server]__0~2q.a0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0r9zg10._.js +115 -0
- package/.next/standalone/.next/server/chunks/ssr/_0wmhtx3._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0~a9dyk._.js +115 -0
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_s_[token]_page_actions_0bubzp7.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0s4yn43._.js → node_modules__pnpm_0-w6~h.._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0fh.6ir._.js → node_modules__pnpm_0.eeqiu._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0d~ida~._.js → node_modules__pnpm_016w5te._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0iikbcy._.js → node_modules__pnpm_04o4n28._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0elpfsb._.js → node_modules__pnpm_05bngu6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0xa.ko1._.js → node_modules__pnpm_05cs0sp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_05~w-ok._.js → node_modules__pnpm_05w~588._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_00y7foi._.js → node_modules__pnpm_05~bobn._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0arbjru._.js → node_modules__pnpm_07jyfax._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0s8fvbn._.js → node_modules__pnpm_07s54yb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0c7u76a._.js → node_modules__pnpm_09ygxyg._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0aq-myi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_12.ymhl._.js → node_modules__pnpm_0dx-.0x._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0beormu._.js → node_modules__pnpm_0e.k7ds._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_03.1jli._.js → node_modules__pnpm_0fvoxey._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0.kyqfq._.js → node_modules__pnpm_0klv8-e._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0lzb-n~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0.~goq~._.js → node_modules__pnpm_0m4c6iy._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0dbr7c2._.js → node_modules__pnpm_0ms-2au._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0vyv.lz._.js → node_modules__pnpm_0nni9e7._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09d5yyu._.js → node_modules__pnpm_0oihvhk._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0b5fla7._.js → node_modules__pnpm_0q0mf37._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_03z3na-._.js → node_modules__pnpm_0q2jvgv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0mvih7b._.js → node_modules__pnpm_0qy4lz-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09eo8jh._.js → node_modules__pnpm_0uea699._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0qd2ovj._.js → node_modules__pnpm_0xxpa5a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0adm8h6._.js → node_modules__pnpm_0z4ojf1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0tq8zs6._.js → node_modules__pnpm_11u67yf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0fm6wcx._.js → node_modules__pnpm_13fk5i4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_page_tsx_0ss2.w7._.js +19 -0
- package/.next/standalone/.next/server/edge/chunks/0p91_next_dist_0nh.6nc._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +5 -5
- package/.next/standalone/.next/server/middleware-manifest.json +1 -1
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +3 -0
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/static/chunks/03zepg.10g9nk.js +21 -0
- package/.next/standalone/.next/static/chunks/07pa3l2g0aoxc.css +2 -0
- package/.next/standalone/.next/static/chunks/07rj172u~.3lw.js +113 -0
- package/.next/standalone/.next/static/chunks/0cre2g95gqnc_.js +1 -0
- package/.next/standalone/.next/static/chunks/{144e01xuvhx~x.js → 0g5dv59skfo1z.js} +1 -1
- package/.next/standalone/.next/static/chunks/0l794ei7~55us.js +17 -0
- package/.next/standalone/.next/static/chunks/{14n5cp8rr-k_b.js → 0qiz7kkyaxa93.js} +1 -1
- package/.next/standalone/.next/static/chunks/0r9y0mkr29ns6.js +113 -0
- package/.next/standalone/.next/static/chunks/0vhw1us0pjfdy.js +1 -0
- package/.next/standalone/.next/static/chunks/{06iw_iy5e90d4.js → 0vp-ahhagxptc.js} +1 -1
- package/.next/standalone/.next/static/chunks/0xpx9ekm-~h19.js +1 -0
- package/.next/standalone/.next/static/chunks/{0b84.439zffwm.js → 0yhis._5rr6tc.js} +1 -1
- package/.next/standalone/.next/static/chunks/139g2hzko-flp.js +1 -0
- package/.next/standalone/.next/static/chunks/{turbopack-0lf4~b-ofzbm6.js → turbopack-12~z-mr7b9b50.js} +1 -1
- package/.next/standalone/README.md +1 -0
- package/.next/standalone/bin/wiki-viewer.js +7 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/src/app/api/share/[token]/route.ts +269 -0
- package/.next/standalone/src/app/api/share/route.ts +127 -0
- package/.next/standalone/src/app/globals.css +2 -0
- package/.next/standalone/src/app/page.tsx +21 -0
- package/.next/standalone/src/app/s/[token]/page.tsx +357 -0
- package/.next/standalone/src/components/share-dialog.tsx +307 -0
- package/.next/standalone/src/components/ui/switch.tsx +1 -1
- package/.next/standalone/src/lib/shared-docs/db.ts +177 -0
- package/.next/standalone/src/middleware.ts +1 -0
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/README.md +1 -0
- package/bin/wiki-viewer.js +7 -0
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-244bv._.js +0 -16
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__012753j._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03p0ob1._.js +0 -16
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gda_iu._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jk1uf4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nd.b_c._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13aid91._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0pqaawz._.js +0 -131
- package/.next/standalone/.next/static/chunks/09-jtayuhrq~b.js +0 -1
- package/.next/standalone/.next/static/chunks/0vp2gi~fq70je.js +0 -21
- package/.next/standalone/.next/static/chunks/125_k3o0s4cid.js +0 -129
- package/.next/standalone/.next/static/chunks/135c~rq_ux73w.js +0 -1
- package/.next/standalone/.next/static/chunks/167ph4xws_-61.css +0 -2
- /package/.next/standalone/.next/static/{YQHDns_jLqFd_bbnLafs0 → 30WI22NYlyxn2Cei0x9Om}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{YQHDns_jLqFd_bbnLafs0 → 30WI22NYlyxn2Cei0x9Om}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{YQHDns_jLqFd_bbnLafs0 → 30WI22NYlyxn2Cei0x9Om}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { checkOrigin } from "@/lib/auth/csrf";
|
|
3
|
+
import { requireUser } from "@/lib/auth/server";
|
|
4
|
+
import { getWorkspace } from "@/lib/workspaces";
|
|
5
|
+
import { safeAbsPath } from "@/lib/proof/raw-fs";
|
|
6
|
+
import { checkAndConsume } from "@/lib/proof/rate-limit";
|
|
7
|
+
import {
|
|
8
|
+
getShareByToken,
|
|
9
|
+
verifyPassword,
|
|
10
|
+
revokeShare,
|
|
11
|
+
isExpired,
|
|
12
|
+
incrementViewCount,
|
|
13
|
+
} from "@/lib/shared-docs/db";
|
|
14
|
+
|
|
15
|
+
const MAX_DISPLAY_SIZE = 1 * 1024 * 1024; // 1MB
|
|
16
|
+
|
|
17
|
+
// ── Shared helper: read file content for a resolved share ────────────────────
|
|
18
|
+
|
|
19
|
+
async function resolveContent(
|
|
20
|
+
token: string,
|
|
21
|
+
): Promise<
|
|
22
|
+
| { ok: true; content: string; filename: string; viewCount: number }
|
|
23
|
+
| { ok: false; response: NextResponse }
|
|
24
|
+
> {
|
|
25
|
+
const share = getShareByToken(token);
|
|
26
|
+
if (!share) {
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
response: NextResponse.json(
|
|
30
|
+
{ error: "not_found", message: "Share link not found" },
|
|
31
|
+
{ status: 404 },
|
|
32
|
+
),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (share.isRevoked) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
response: NextResponse.json(
|
|
40
|
+
{ error: "revoked", message: "Share link has been revoked" },
|
|
41
|
+
{ status: 410 },
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (isExpired(share)) {
|
|
47
|
+
return {
|
|
48
|
+
ok: false,
|
|
49
|
+
response: NextResponse.json(
|
|
50
|
+
{ error: "expired", message: "Share link has expired" },
|
|
51
|
+
{ status: 410 },
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const ws = await getWorkspace(share.workspaceId);
|
|
57
|
+
if (!ws) {
|
|
58
|
+
return {
|
|
59
|
+
ok: false,
|
|
60
|
+
response: NextResponse.json(
|
|
61
|
+
{ error: "workspace_gone", message: "Workspace no longer exists" },
|
|
62
|
+
{ status: 410 },
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const absPath = await safeAbsPath(ws.rootDir, share.filePath);
|
|
68
|
+
if (!absPath) {
|
|
69
|
+
return {
|
|
70
|
+
ok: false,
|
|
71
|
+
response: NextResponse.json(
|
|
72
|
+
{ error: "path_invalid", message: "Invalid file path" },
|
|
73
|
+
{ status: 400 },
|
|
74
|
+
),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const { readFile, stat } = await import("node:fs/promises");
|
|
79
|
+
try {
|
|
80
|
+
const info = await stat(absPath);
|
|
81
|
+
if (info.size > MAX_DISPLAY_SIZE) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
response: NextResponse.json(
|
|
85
|
+
{ error: "too_large", message: "File too large to share (max 1MB)" },
|
|
86
|
+
{ status: 413 },
|
|
87
|
+
),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
} catch {
|
|
91
|
+
return {
|
|
92
|
+
ok: false,
|
|
93
|
+
response: NextResponse.json(
|
|
94
|
+
{ error: "file_gone", message: "File no longer exists" },
|
|
95
|
+
{ status: 410 },
|
|
96
|
+
),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let content: string;
|
|
101
|
+
try {
|
|
102
|
+
const buffer = await readFile(absPath);
|
|
103
|
+
content = buffer.toString("utf-8");
|
|
104
|
+
} catch (err: unknown) {
|
|
105
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
106
|
+
console.error("[share] readFile(%s) %s", absPath, detail);
|
|
107
|
+
return {
|
|
108
|
+
ok: false,
|
|
109
|
+
response: NextResponse.json(
|
|
110
|
+
{ error: "read_error", message: "Failed to read file" },
|
|
111
|
+
{ status: 500 },
|
|
112
|
+
),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
incrementViewCount(token);
|
|
117
|
+
const filename = share.filePath.split("/").pop() ?? share.filePath;
|
|
118
|
+
|
|
119
|
+
return { ok: true, content, filename, viewCount: share.viewCount + 1 };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// ── GET: Resolve a share link (public) ───────────────────────────────────────
|
|
123
|
+
|
|
124
|
+
export async function GET(
|
|
125
|
+
request: Request,
|
|
126
|
+
{ params }: { params: Promise<{ token: string }> },
|
|
127
|
+
) {
|
|
128
|
+
const { token } = await params;
|
|
129
|
+
|
|
130
|
+
const rl = checkAndConsume(`share:${token}`, 1);
|
|
131
|
+
if (!rl.ok) {
|
|
132
|
+
return NextResponse.json(
|
|
133
|
+
{ error: "rate_limited", message: "Too many requests" },
|
|
134
|
+
{
|
|
135
|
+
status: 429,
|
|
136
|
+
headers: { "Retry-After": String(Math.ceil(rl.retryAfterMs / 1000)) },
|
|
137
|
+
},
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const share = getShareByToken(token);
|
|
142
|
+
if (!share) {
|
|
143
|
+
return NextResponse.json(
|
|
144
|
+
{ error: "not_found", message: "Share link not found" },
|
|
145
|
+
{ status: 404 },
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (share.isRevoked) {
|
|
150
|
+
return NextResponse.json(
|
|
151
|
+
{ error: "revoked", message: "Share link has been revoked" },
|
|
152
|
+
{ status: 410 },
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (isExpired(share)) {
|
|
157
|
+
return NextResponse.json(
|
|
158
|
+
{ error: "expired", message: "Share link has expired" },
|
|
159
|
+
{ status: 410 },
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Password-protected: tell client to POST to /unlock instead
|
|
164
|
+
if (share.passwordHash) {
|
|
165
|
+
return NextResponse.json(
|
|
166
|
+
{ protected: true, message: "This document is password-protected" },
|
|
167
|
+
{ status: 401 },
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const result = await resolveContent(token);
|
|
172
|
+
if (!result.ok) return result.response;
|
|
173
|
+
|
|
174
|
+
return NextResponse.json({
|
|
175
|
+
content: result.content,
|
|
176
|
+
filename: result.filename,
|
|
177
|
+
viewCount: result.viewCount,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ── POST: Unlock a password-protected share ───────────────────────────────────
|
|
182
|
+
|
|
183
|
+
export async function POST(
|
|
184
|
+
request: Request,
|
|
185
|
+
{ params }: { params: Promise<{ token: string }> },
|
|
186
|
+
) {
|
|
187
|
+
const { token } = await params;
|
|
188
|
+
|
|
189
|
+
const share = getShareByToken(token);
|
|
190
|
+
if (!share) {
|
|
191
|
+
return NextResponse.json({ error: "not_found" }, { status: 404 });
|
|
192
|
+
}
|
|
193
|
+
if (share.isRevoked) {
|
|
194
|
+
return NextResponse.json({ error: "revoked" }, { status: 410 });
|
|
195
|
+
}
|
|
196
|
+
if (isExpired(share)) {
|
|
197
|
+
return NextResponse.json({ error: "expired" }, { status: 410 });
|
|
198
|
+
}
|
|
199
|
+
if (!share.passwordHash) {
|
|
200
|
+
return NextResponse.json({ error: "not_protected" }, { status: 400 });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Rate limit password attempts
|
|
204
|
+
const rl = checkAndConsume(`share-pwd:${token}`, 1);
|
|
205
|
+
if (!rl.ok) {
|
|
206
|
+
return NextResponse.json(
|
|
207
|
+
{ error: "rate_limited", message: "Too many attempts. Try again later." },
|
|
208
|
+
{
|
|
209
|
+
status: 429,
|
|
210
|
+
headers: { "Retry-After": String(Math.ceil(rl.retryAfterMs / 1000)) },
|
|
211
|
+
},
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const body: { password?: string } = await request.json();
|
|
216
|
+
if (!body.password || typeof body.password !== "string") {
|
|
217
|
+
return NextResponse.json({ error: "missing_password" }, { status: 400 });
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (!verifyPassword(body.password, share.passwordHash)) {
|
|
221
|
+
return NextResponse.json(
|
|
222
|
+
{ error: "wrong_password", message: "Incorrect password" },
|
|
223
|
+
{ status: 403 },
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const result = await resolveContent(token);
|
|
228
|
+
if (!result.ok) return result.response;
|
|
229
|
+
|
|
230
|
+
return NextResponse.json({
|
|
231
|
+
content: result.content,
|
|
232
|
+
filename: result.filename,
|
|
233
|
+
viewCount: result.viewCount,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ── DELETE: Revoke a share link (auth required) ───────────────────────────────
|
|
238
|
+
|
|
239
|
+
export async function DELETE(
|
|
240
|
+
request: Request,
|
|
241
|
+
{ params }: { params: Promise<{ token: string }> },
|
|
242
|
+
) {
|
|
243
|
+
const { token } = await params;
|
|
244
|
+
|
|
245
|
+
const csrf = checkOrigin(request);
|
|
246
|
+
if (csrf) return csrf;
|
|
247
|
+
|
|
248
|
+
const auth = await requireUser(request);
|
|
249
|
+
if (!auth.ok) {
|
|
250
|
+
return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const share = getShareByToken(token);
|
|
254
|
+
if (!share) {
|
|
255
|
+
return NextResponse.json({ error: "not_found" }, { status: 404 });
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (share.createdBy !== auth.user.id) {
|
|
259
|
+
const { isAdmin } = await import("@/lib/auth/admin");
|
|
260
|
+
const admin = await isAdmin(auth.user.id, auth.user.email);
|
|
261
|
+
if (!admin) {
|
|
262
|
+
return NextResponse.json({ error: "FORBIDDEN" }, { status: 403 });
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
revokeShare(share.id);
|
|
267
|
+
|
|
268
|
+
return NextResponse.json({ ok: true });
|
|
269
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { checkOrigin } from "@/lib/auth/csrf";
|
|
3
|
+
import { requireUser } from "@/lib/auth/server";
|
|
4
|
+
import { resolveWorkspaceForUser } from "@/lib/workspace-context";
|
|
5
|
+
import { safeAbsPath } from "@/lib/proof/raw-fs";
|
|
6
|
+
import {
|
|
7
|
+
createShare,
|
|
8
|
+
listSharesForFile,
|
|
9
|
+
} from "@/lib/shared-docs/db";
|
|
10
|
+
|
|
11
|
+
// ── POST: Create a share link ─────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export async function POST(request: Request) {
|
|
14
|
+
const csrf = checkOrigin(request);
|
|
15
|
+
if (csrf) return csrf;
|
|
16
|
+
|
|
17
|
+
// Must be signed in
|
|
18
|
+
const auth = await requireUser(request);
|
|
19
|
+
if (!auth.ok) {
|
|
20
|
+
return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ctx = await resolveWorkspaceForUser(request);
|
|
24
|
+
if (!ctx.ok) {
|
|
25
|
+
return NextResponse.json({ error: ctx.code }, { status: ctx.status });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const body: {
|
|
29
|
+
path?: string;
|
|
30
|
+
password?: string;
|
|
31
|
+
expiresAt?: string;
|
|
32
|
+
} = await request.json();
|
|
33
|
+
|
|
34
|
+
const relPath = body.path;
|
|
35
|
+
if (!relPath || typeof relPath !== "string") {
|
|
36
|
+
return NextResponse.json({ error: "Missing path" }, { status: 400 });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Verify the file exists and belongs to this workspace
|
|
40
|
+
const absPath = await safeAbsPath(ctx.rootDir, relPath);
|
|
41
|
+
if (!absPath) {
|
|
42
|
+
return NextResponse.json({ error: "Invalid path" }, { status: 400 });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const { stat } = await import("node:fs/promises");
|
|
46
|
+
try {
|
|
47
|
+
await stat(absPath);
|
|
48
|
+
} catch {
|
|
49
|
+
return NextResponse.json({ error: "File not found" }, { status: 404 });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Validate optional params
|
|
53
|
+
if (body.password !== undefined && typeof body.password !== "string") {
|
|
54
|
+
return NextResponse.json({ error: "Invalid password" }, { status: 400 });
|
|
55
|
+
}
|
|
56
|
+
if (
|
|
57
|
+
body.expiresAt !== undefined &&
|
|
58
|
+
body.expiresAt !== null &&
|
|
59
|
+
typeof body.expiresAt !== "string"
|
|
60
|
+
) {
|
|
61
|
+
return NextResponse.json({ error: "Invalid expiresAt" }, { status: 400 });
|
|
62
|
+
}
|
|
63
|
+
// Reject invalid or already-expired dates
|
|
64
|
+
if (body.expiresAt) {
|
|
65
|
+
const d = new Date(body.expiresAt);
|
|
66
|
+
if (isNaN(d.getTime())) {
|
|
67
|
+
return NextResponse.json({ error: "Invalid date" }, { status: 400 });
|
|
68
|
+
}
|
|
69
|
+
if (d.getTime() < Date.now()) {
|
|
70
|
+
return NextResponse.json({ error: "Date is in the past" }, { status: 400 });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const share = createShare({
|
|
75
|
+
workspaceId: ctx.ws.id,
|
|
76
|
+
filePath: relPath,
|
|
77
|
+
password: body.password && body.password.length > 0 ? body.password : undefined,
|
|
78
|
+
expiresAt: body.expiresAt || undefined,
|
|
79
|
+
createdBy: auth.user.id,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return NextResponse.json({
|
|
83
|
+
token: share.token,
|
|
84
|
+
url: `/s/${share.token}`,
|
|
85
|
+
hasPassword: !!share.passwordHash,
|
|
86
|
+
expiresAt: share.expiresAt,
|
|
87
|
+
createdAt: share.createdAt,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ── GET: List share links for a file ──────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
export async function GET(request: Request) {
|
|
94
|
+
const csrf = checkOrigin(request);
|
|
95
|
+
if (csrf) return csrf;
|
|
96
|
+
|
|
97
|
+
const auth = await requireUser(request);
|
|
98
|
+
if (!auth.ok) {
|
|
99
|
+
return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const ctx = await resolveWorkspaceForUser(request);
|
|
103
|
+
if (!ctx.ok) {
|
|
104
|
+
return NextResponse.json({ error: ctx.code }, { status: ctx.status });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const { searchParams } = new URL(request.url);
|
|
108
|
+
const relPath = searchParams.get("path");
|
|
109
|
+
if (!relPath) {
|
|
110
|
+
return NextResponse.json({ error: "Missing path" }, { status: 400 });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const shares = listSharesForFile(ctx.ws.id, relPath);
|
|
114
|
+
|
|
115
|
+
return NextResponse.json({
|
|
116
|
+
shares: shares.map((s) => ({
|
|
117
|
+
id: s.id,
|
|
118
|
+
token: s.token,
|
|
119
|
+
url: `/s/${s.token}`,
|
|
120
|
+
hasPassword: !!s.passwordHash,
|
|
121
|
+
expiresAt: s.expiresAt,
|
|
122
|
+
createdAt: s.createdAt,
|
|
123
|
+
viewCount: s.viewCount,
|
|
124
|
+
isExpired: s.expiresAt ? new Date(s.expiresAt) < new Date() : false,
|
|
125
|
+
})),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
--warning-ink: #a16207;
|
|
32
32
|
--border: #e7e5e4;
|
|
33
33
|
--input: #d6d3d1;
|
|
34
|
+
--switch-checked: #292524;
|
|
34
35
|
--ring: #292524;
|
|
35
36
|
--radius: 8px;
|
|
36
37
|
|
|
@@ -127,6 +128,7 @@
|
|
|
127
128
|
--warning-ink: #fbbf24;
|
|
128
129
|
--border: #292524;
|
|
129
130
|
--input: #292524;
|
|
131
|
+
--switch-checked: #f5f5f5;
|
|
130
132
|
--ring: #ffffff;
|
|
131
133
|
|
|
132
134
|
--chart-1: #ffffff;
|
|
@@ -26,7 +26,12 @@ import {
|
|
|
26
26
|
Pin,
|
|
27
27
|
Plus,
|
|
28
28
|
RefreshCw,
|
|
29
|
+
Search,
|
|
29
30
|
Settings,
|
|
31
|
+
Share,
|
|
32
|
+
Slash,
|
|
33
|
+
SortAsc,
|
|
34
|
+
Sparkles,
|
|
30
35
|
Star,
|
|
31
36
|
Terminal,
|
|
32
37
|
Trash2,
|
|
@@ -62,6 +67,7 @@ import { getActiveWorkspaceId, withWs, wsFetch } from "@/lib/workspace-client";
|
|
|
62
67
|
import { markdownToHtml } from "@/lib/markdown/to-html";
|
|
63
68
|
import { ThemeToggle } from "@/components/theme-toggle";
|
|
64
69
|
import { AuthSettingsSheet } from "@/components/auth-settings-sheet";
|
|
70
|
+
import { ShareDialog } from "@/components/share-dialog";
|
|
65
71
|
import { Button } from "@/components/ui/button";
|
|
66
72
|
import { Card } from "@/components/ui/card";
|
|
67
73
|
|
|
@@ -367,6 +373,7 @@ export default function Page() {
|
|
|
367
373
|
const [appKey, setAppKey] = useState(0);
|
|
368
374
|
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
|
|
369
375
|
const [settingsOpen, setSettingsOpen] = useState(false);
|
|
376
|
+
const [shareDialogOpen, setShareDialogOpen] = useState(false);
|
|
370
377
|
const [fileContent, setFileContent] = useState<string | null>(null);
|
|
371
378
|
const [fileRevision, setFileRevision] = useState(0);
|
|
372
379
|
const [fileLoading, setFileLoading] = useState(false);
|
|
@@ -2108,6 +2115,15 @@ export default function Page() {
|
|
|
2108
2115
|
</div>
|
|
2109
2116
|
<div className="flex items-center gap-1 shrink-0">
|
|
2110
2117
|
{renderCopyMenu(openFile)}
|
|
2118
|
+
<Button
|
|
2119
|
+
size="sm"
|
|
2120
|
+
variant="ghost"
|
|
2121
|
+
className="h-7 w-7 p-0"
|
|
2122
|
+
title="Share"
|
|
2123
|
+
onClick={() => setShareDialogOpen(true)}
|
|
2124
|
+
>
|
|
2125
|
+
<Share className="h-3.5 w-3.5" />
|
|
2126
|
+
</Button>
|
|
2111
2127
|
{isText(openFile.name) &&
|
|
2112
2128
|
!editing &&
|
|
2113
2129
|
(fileContent !== null || isMarkdown(openFile.name)) && (
|
|
@@ -2296,6 +2312,11 @@ export default function Page() {
|
|
|
2296
2312
|
)}
|
|
2297
2313
|
</div>
|
|
2298
2314
|
|
|
2315
|
+
<ShareDialog
|
|
2316
|
+
open={shareDialogOpen}
|
|
2317
|
+
onOpenChange={setShareDialogOpen}
|
|
2318
|
+
filePath={openFile?.path ?? ""}
|
|
2319
|
+
/>
|
|
2299
2320
|
<AuthSettingsSheet open={settingsOpen} onOpenChange={setSettingsOpen} />
|
|
2300
2321
|
<AIPanel currentPath={openFile?.path} />
|
|
2301
2322
|
<input
|