jamdesk 1.1.7 → 1.1.9
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/README.md +5 -2
- package/dist/lib/deps.js +3 -3
- package/dist/lib/openapi/types.d.ts +11 -6
- package/dist/lib/openapi/types.d.ts.map +1 -1
- package/dist/lib/path-security.d.ts +3 -0
- package/dist/lib/path-security.d.ts.map +1 -1
- package/dist/lib/path-security.js +14 -1
- package/dist/lib/path-security.js.map +1 -1
- package/dist/lib/tech-words.js +5 -5
- package/dist/lib/tech-words.js.map +1 -1
- package/package.json +13 -10
- package/vendored/app/[[...slug]]/page.tsx +50 -13
- package/vendored/app/api/assets/[...path]/route.ts +2 -0
- package/vendored/components/layout/LayoutWrapper.tsx +3 -4
- package/vendored/components/mdx/ApiEndpoint.tsx +13 -2
- package/vendored/components/mdx/MDXComponents.tsx +16 -0
- package/vendored/components/mdx/OpenApiEndpoint.tsx +76 -36
- package/vendored/components/mdx/Tabs.tsx +1 -1
- package/vendored/components/mdx/Video.tsx +82 -0
- package/vendored/components/navigation/Header.tsx +3 -3
- package/vendored/components/navigation/Sidebar.tsx +3 -3
- package/vendored/components/ui/CodePanel.tsx +5 -5
- package/vendored/components/ui/CodePanelModal.tsx +3 -3
- package/vendored/components/ui/DevOnlyNotice.tsx +78 -0
- package/vendored/hooks/useChatPanel.tsx +21 -2
- package/vendored/hooks/useMediaQuery.ts +27 -0
- package/vendored/lib/build-endpoint-from-mdx.ts +66 -0
- package/vendored/lib/isr-build-executor.ts +1 -1
- package/vendored/lib/middleware-helpers.ts +26 -1
- package/vendored/lib/openapi/code-examples.ts +479 -99
- package/vendored/lib/openapi/index.ts +9 -1
- package/vendored/lib/openapi/types.ts +29 -5
- package/vendored/lib/preprocess-mdx.ts +103 -36
- package/vendored/lib/process-mdx-with-exports.ts +22 -14
- package/vendored/lib/remark-extract-param-fields.ts +134 -0
- package/vendored/lib/shiki-client.ts +12 -0
- package/vendored/lib/static-artifacts.ts +2 -1
- package/vendored/lib/url-safety.ts +122 -0
- package/vendored/next.config.js +8 -0
- package/vendored/schema/docs-schema.json +16 -3
- package/vendored/scripts/copy-files.cjs +60 -54
- package/vendored/scripts/validate-links.cjs +1 -1
- package/vendored/shared/path-security.ts +17 -1
|
@@ -291,6 +291,7 @@ export const INTERNAL_API_ROUTES = [
|
|
|
291
291
|
'/api/chat', // Chat endpoint (app/api/chat/[project])
|
|
292
292
|
'/api/mcp', // MCP endpoint (app/api/mcp/[project])
|
|
293
293
|
'/api/og', // OG image generation (app/api/og)
|
|
294
|
+
'/api/playground', // API playground (token, proxy, demo) — must skip hostAtDocs redirect
|
|
294
295
|
'/api/r2', // R2 content serving (app/api/r2/[project]/[...path])
|
|
295
296
|
'/api/revalidate', // Cache revalidation (app/api/revalidate)
|
|
296
297
|
'/api/search-ev', // Search analytics proxy (app/api/search-ev)
|
|
@@ -420,6 +421,25 @@ export function getChatApiPath(projectSlug: string): string {
|
|
|
420
421
|
return `/api/chat/${projectSlug}`;
|
|
421
422
|
}
|
|
422
423
|
|
|
424
|
+
const PLAYGROUND_PREFIX = '/_jd/playground/';
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Check if this is a playground API request routed via /_jd/.
|
|
428
|
+
*
|
|
429
|
+
* Custom domain setups (hostAtDocs) proxy /_jd/* but not /api/*, so the
|
|
430
|
+
* playground client uses /_jd/playground/* to reach token/proxy/demo routes.
|
|
431
|
+
*/
|
|
432
|
+
export function isPlaygroundRequest(pathname: string): boolean {
|
|
433
|
+
return pathname.startsWith(PLAYGROUND_PREFIX);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Get the /api/playground/* path from a /_jd/playground/* request.
|
|
438
|
+
*/
|
|
439
|
+
export function getPlaygroundApiPath(pathname: string): string {
|
|
440
|
+
return '/api/playground/' + pathname.slice(PLAYGROUND_PREFIX.length);
|
|
441
|
+
}
|
|
442
|
+
|
|
423
443
|
/**
|
|
424
444
|
* Check if path needs trailing slash normalization.
|
|
425
445
|
*
|
|
@@ -491,7 +511,7 @@ export function buildProjectHeaders(
|
|
|
491
511
|
/**
|
|
492
512
|
* Asset extensions that need to be routed to the assets API.
|
|
493
513
|
*/
|
|
494
|
-
const ASSET_EXTENSIONS = ['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.pdf'];
|
|
514
|
+
const ASSET_EXTENSIONS = ['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.pdf', '.mp4', '.webm'];
|
|
495
515
|
|
|
496
516
|
/**
|
|
497
517
|
* Project-specific files that need to be fetched from R2 via assets API.
|
|
@@ -522,6 +542,11 @@ export function isAssetRequest(pathname: string): boolean {
|
|
|
522
542
|
return true;
|
|
523
543
|
}
|
|
524
544
|
|
|
545
|
+
// Project videos under /_jd/videos/ are served from R2
|
|
546
|
+
if (pathname.startsWith(`${ASSET_PREFIX}/videos/`)) {
|
|
547
|
+
return true;
|
|
548
|
+
}
|
|
549
|
+
|
|
525
550
|
// Project-specific files from R2, or files with asset extensions
|
|
526
551
|
return (
|
|
527
552
|
PROJECT_SPECIFIC_FILES.includes(pathname) ||
|