@kirchdev/duxt 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +151 -0
- package/app/app.config.ts +13 -0
- package/app/app.vue +122 -0
- package/app/assets/css/duxt.css +555 -0
- package/app/assets/css/typeset.css +498 -0
- package/app/components/DuxtBrand.vue +53 -0
- package/app/components/DuxtBreadcrumb.vue +37 -0
- package/app/components/DuxtCodeBlock.vue +143 -0
- package/app/components/DuxtCopyPage.vue +117 -0
- package/app/components/DuxtFooter.vue +86 -0
- package/app/components/DuxtHeader.vue +496 -0
- package/app/components/DuxtJsonEditor.vue +359 -0
- package/app/components/DuxtLandingProse.vue +90 -0
- package/app/components/DuxtLandingShowcase.vue +295 -0
- package/app/components/DuxtLiveWindow.vue +343 -0
- package/app/components/DuxtLocale.vue +86 -0
- package/app/components/DuxtMetaList.vue +76 -0
- package/app/components/DuxtNavigation.vue +94 -0
- package/app/components/DuxtNavigationLink.vue +41 -0
- package/app/components/DuxtOpenApiCallbacks.vue +92 -0
- package/app/components/DuxtOpenApiClient.vue +1339 -0
- package/app/components/DuxtOpenApiMedia.vue +108 -0
- package/app/components/DuxtOpenApiMethod.vue +59 -0
- package/app/components/DuxtOpenApiParameters.vue +114 -0
- package/app/components/DuxtOpenApiResponses.vue +109 -0
- package/app/components/DuxtOpenApiSchema.vue +365 -0
- package/app/components/DuxtOpenApiSecurity.vue +115 -0
- package/app/components/DuxtPageFeedback.vue +56 -0
- package/app/components/DuxtPageInfo.vue +194 -0
- package/app/components/DuxtPageNav.vue +93 -0
- package/app/components/DuxtPreviewSkeleton.vue +262 -0
- package/app/components/DuxtProgress.vue +45 -0
- package/app/components/DuxtSearch.vue +271 -0
- package/app/components/DuxtSections.vue +65 -0
- package/app/components/DuxtShortcuts.vue +46 -0
- package/app/components/DuxtSkipLink.vue +34 -0
- package/app/components/DuxtToc.vue +86 -0
- package/app/components/DuxtTranslationBanner.vue +64 -0
- package/app/components/DuxtVersion.vue +168 -0
- package/app/components/DuxtVersionBanner.vue +109 -0
- package/app/components/OgImage/Duxt.satori.vue +82 -0
- package/app/components/content/Accordion.vue +37 -0
- package/app/components/content/AccordionItem.vue +46 -0
- package/app/components/content/Callout.vue +58 -0
- package/app/components/content/ChangelogGroup.vue +91 -0
- package/app/components/content/ChangelogReleases.vue +520 -0
- package/app/components/content/CodeGroup.vue +183 -0
- package/app/components/content/DevtoolsPanel.vue +107 -0
- package/app/components/content/Field.vue +50 -0
- package/app/components/content/FieldGroup.vue +8 -0
- package/app/components/content/FileTree.vue +92 -0
- package/app/components/content/Mermaid.vue +70 -0
- package/app/components/content/OpenApiOperation.vue +185 -0
- package/app/components/content/OpenApiOperations.vue +72 -0
- package/app/components/content/OpenApiOverview.vue +302 -0
- package/app/components/content/PackageManagers.vue +187 -0
- package/app/components/content/PageCards.vue +48 -0
- package/app/components/content/Partial.vue +65 -0
- package/app/components/content/Preview.vue +173 -0
- package/app/components/content/ProseA.vue +55 -0
- package/app/components/content/ProseH2.vue +53 -0
- package/app/components/content/ProseH3.vue +53 -0
- package/app/components/content/ProseH4.vue +53 -0
- package/app/components/content/ProseImg.vue +87 -0
- package/app/components/content/ProsePre.vue +58 -0
- package/app/components/content/ProseTable.vue +11 -0
- package/app/components/content/Since.vue +21 -0
- package/app/components/content/Steps.vue +20 -0
- package/app/components/content/Tab.vue +23 -0
- package/app/components/content/TabGroup.vue +58 -0
- package/app/components/ui/alert/Alert.vue +21 -0
- package/app/components/ui/alert/AlertDescription.vue +22 -0
- package/app/components/ui/alert/AlertTitle.vue +22 -0
- package/app/components/ui/alert/index.ts +24 -0
- package/app/components/ui/badge/Badge.vue +28 -0
- package/app/components/ui/badge/index.ts +52 -0
- package/app/components/ui/breadcrumb/Breadcrumb.vue +13 -0
- package/app/components/ui/breadcrumb/BreadcrumbEllipsis.vue +22 -0
- package/app/components/ui/breadcrumb/BreadcrumbItem.vue +17 -0
- package/app/components/ui/breadcrumb/BreadcrumbLink.vue +24 -0
- package/app/components/ui/breadcrumb/BreadcrumbList.vue +22 -0
- package/app/components/ui/breadcrumb/BreadcrumbPage.vue +20 -0
- package/app/components/ui/breadcrumb/BreadcrumbSeparator.vue +21 -0
- package/app/components/ui/breadcrumb/index.ts +7 -0
- package/app/components/ui/button/Button.vue +31 -0
- package/app/components/ui/button/index.ts +39 -0
- package/app/components/ui/card/Card.vue +22 -0
- package/app/components/ui/card/CardAction.vue +22 -0
- package/app/components/ui/card/CardContent.vue +14 -0
- package/app/components/ui/card/CardDescription.vue +17 -0
- package/app/components/ui/card/CardFooter.vue +17 -0
- package/app/components/ui/card/CardHeader.vue +22 -0
- package/app/components/ui/card/CardTitle.vue +17 -0
- package/app/components/ui/card/index.ts +7 -0
- package/app/components/ui/collapsible/Collapsible.vue +19 -0
- package/app/components/ui/collapsible/CollapsibleContent.vue +12 -0
- package/app/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
- package/app/components/ui/collapsible/index.ts +3 -0
- package/app/components/ui/command/Command.vue +98 -0
- package/app/components/ui/command/CommandDialog.vue +42 -0
- package/app/components/ui/command/CommandEmpty.vue +31 -0
- package/app/components/ui/command/CommandGroup.vue +52 -0
- package/app/components/ui/command/CommandInput.vue +45 -0
- package/app/components/ui/command/CommandItem.vue +85 -0
- package/app/components/ui/command/CommandList.vue +32 -0
- package/app/components/ui/command/CommandSeparator.vue +23 -0
- package/app/components/ui/command/CommandShortcut.vue +19 -0
- package/app/components/ui/command/index.ts +29 -0
- package/app/components/ui/dialog/Dialog.vue +15 -0
- package/app/components/ui/dialog/DialogClose.vue +12 -0
- package/app/components/ui/dialog/DialogContent.vue +61 -0
- package/app/components/ui/dialog/DialogDescription.vue +25 -0
- package/app/components/ui/dialog/DialogFooter.vue +30 -0
- package/app/components/ui/dialog/DialogHeader.vue +17 -0
- package/app/components/ui/dialog/DialogOverlay.vue +28 -0
- package/app/components/ui/dialog/DialogScrollContent.vue +65 -0
- package/app/components/ui/dialog/DialogTitle.vue +25 -0
- package/app/components/ui/dialog/DialogTrigger.vue +12 -0
- package/app/components/ui/dialog/index.ts +10 -0
- package/app/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/app/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +47 -0
- package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +47 -0
- package/app/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +41 -0
- package/app/components/ui/dropdown-menu/DropdownMenuLabel.vue +27 -0
- package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +48 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/app/components/ui/dropdown-menu/DropdownMenuShortcut.vue +19 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSubContent.vue +34 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +34 -0
- package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/app/components/ui/dropdown-menu/index.ts +16 -0
- package/app/components/ui/input/Input.vue +35 -0
- package/app/components/ui/input/index.ts +1 -0
- package/app/components/ui/navigation-menu/NavigationMenu.vue +42 -0
- package/app/components/ui/navigation-menu/NavigationMenuContent.vue +35 -0
- package/app/components/ui/navigation-menu/NavigationMenuIndicator.vue +32 -0
- package/app/components/ui/navigation-menu/NavigationMenuItem.vue +23 -0
- package/app/components/ui/navigation-menu/NavigationMenuLink.vue +30 -0
- package/app/components/ui/navigation-menu/NavigationMenuList.vue +30 -0
- package/app/components/ui/navigation-menu/NavigationMenuTrigger.vue +31 -0
- package/app/components/ui/navigation-menu/NavigationMenuViewport.vue +30 -0
- package/app/components/ui/navigation-menu/index.ts +14 -0
- package/app/components/ui/scroll-area/ScrollArea.vue +31 -0
- package/app/components/ui/scroll-area/ScrollBar.vue +38 -0
- package/app/components/ui/scroll-area/index.ts +2 -0
- package/app/components/ui/select/Select.vue +15 -0
- package/app/components/ui/select/SelectContent.vue +59 -0
- package/app/components/ui/select/SelectGroup.vue +19 -0
- package/app/components/ui/select/SelectItem.vue +42 -0
- package/app/components/ui/select/SelectItemText.vue +12 -0
- package/app/components/ui/select/SelectLabel.vue +16 -0
- package/app/components/ui/select/SelectScrollDownButton.vue +28 -0
- package/app/components/ui/select/SelectScrollUpButton.vue +28 -0
- package/app/components/ui/select/SelectSeparator.vue +20 -0
- package/app/components/ui/select/SelectTrigger.vue +32 -0
- package/app/components/ui/select/SelectValue.vue +12 -0
- package/app/components/ui/select/index.ts +11 -0
- package/app/components/ui/separator/Separator.vue +30 -0
- package/app/components/ui/separator/index.ts +1 -0
- package/app/components/ui/sheet/Sheet.vue +15 -0
- package/app/components/ui/sheet/SheetClose.vue +12 -0
- package/app/components/ui/sheet/SheetContent.vue +68 -0
- package/app/components/ui/sheet/SheetDescription.vue +23 -0
- package/app/components/ui/sheet/SheetFooter.vue +15 -0
- package/app/components/ui/sheet/SheetHeader.vue +15 -0
- package/app/components/ui/sheet/SheetOverlay.vue +28 -0
- package/app/components/ui/sheet/SheetTitle.vue +23 -0
- package/app/components/ui/sheet/SheetTrigger.vue +12 -0
- package/app/components/ui/sheet/index.ts +8 -0
- package/app/components/ui/sidebar/Sidebar.vue +110 -0
- package/app/components/ui/sidebar/SidebarContent.vue +23 -0
- package/app/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/app/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/app/components/ui/sidebar/SidebarGroupAction.vue +31 -0
- package/app/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/app/components/ui/sidebar/SidebarGroupLabel.vue +30 -0
- package/app/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/app/components/ui/sidebar/SidebarInput.vue +19 -0
- package/app/components/ui/sidebar/SidebarInset.vue +23 -0
- package/app/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/app/components/ui/sidebar/SidebarMenuAction.vue +42 -0
- package/app/components/ui/sidebar/SidebarMenuBadge.vue +28 -0
- package/app/components/ui/sidebar/SidebarMenuButton.vue +60 -0
- package/app/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
- package/app/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/app/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
- package/app/components/ui/sidebar/SidebarMenuSub.vue +24 -0
- package/app/components/ui/sidebar/SidebarMenuSubButton.vue +43 -0
- package/app/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/app/components/ui/sidebar/SidebarProvider.vue +109 -0
- package/app/components/ui/sidebar/SidebarRail.vue +35 -0
- package/app/components/ui/sidebar/SidebarSeparator.vue +19 -0
- package/app/components/ui/sidebar/SidebarTrigger.vue +26 -0
- package/app/components/ui/sidebar/index.ts +62 -0
- package/app/components/ui/sidebar/utils.ts +19 -0
- package/app/components/ui/skeleton/Skeleton.vue +17 -0
- package/app/components/ui/skeleton/index.ts +1 -0
- package/app/components/ui/sonner/Sonner.vue +67 -0
- package/app/components/ui/sonner/index.ts +1 -0
- package/app/components/ui/tabs/Tabs.vue +26 -0
- package/app/components/ui/tabs/TabsContent.vue +23 -0
- package/app/components/ui/tabs/TabsList.vue +28 -0
- package/app/components/ui/tabs/TabsTrigger.vue +30 -0
- package/app/components/ui/tabs/index.ts +4 -0
- package/app/components/ui/textarea/Textarea.vue +32 -0
- package/app/components/ui/textarea/index.ts +1 -0
- package/app/components/ui/tooltip/Tooltip.vue +15 -0
- package/app/components/ui/tooltip/TooltipContent.vue +49 -0
- package/app/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/app/components/ui/tooltip/TooltipTrigger.vue +12 -0
- package/app/components/ui/tooltip/index.ts +4 -0
- package/app/composables/useActiveHeading.ts +90 -0
- package/app/composables/useDuxtAnimatedHeight.ts +155 -0
- package/app/composables/useDuxtBreadcrumb.ts +60 -0
- package/app/composables/useDuxtChoice.ts +28 -0
- package/app/composables/useDuxtCollection.ts +89 -0
- package/app/composables/useDuxtConfig.ts +47 -0
- package/app/composables/useDuxtNavigation.ts +87 -0
- package/app/composables/useDuxtPageFocus.ts +30 -0
- package/app/composables/useDuxtPath.ts +42 -0
- package/app/composables/useDuxtSearch.ts +208 -0
- package/app/composables/useDuxtSection.ts +44 -0
- package/app/composables/useDuxtSectionRow.ts +49 -0
- package/app/composables/useDuxtShortcuts.ts +58 -0
- package/app/composables/useDuxtSiteUrl.ts +27 -0
- package/app/composables/useDuxtToast.ts +25 -0
- package/app/composables/useDuxtVersion.ts +138 -0
- package/app/composables/useFuzzySearch.ts +83 -0
- package/app/composables/usePackageManager.ts +4 -0
- package/app/composables/useRecentPages.ts +52 -0
- package/app/error.vue +133 -0
- package/app/layouts/changelog.vue +85 -0
- package/app/layouts/default.vue +23 -0
- package/app/layouts/docs.vue +62 -0
- package/app/layouts/reference.vue +85 -0
- package/app/lib/utils.ts +7 -0
- package/app/middleware/duxt-section-layout.global.ts +57 -0
- package/app/pages/[...slug].vue +441 -0
- package/app/pages/index.vue +479 -0
- package/app/types/duxt.d.ts +955 -0
- package/app/utils/aside.ts +16 -0
- package/app/utils/changelog.ts +182 -0
- package/app/utils/code-highlight.ts +116 -0
- package/app/utils/duxt-config.ts +185 -0
- package/app/utils/duxt-text.ts +135 -0
- package/app/utils/file-icons.ts +62 -0
- package/app/utils/generated-sections.ts +190 -0
- package/app/utils/generated-toc.ts +216 -0
- package/app/utils/heading-link.ts +32 -0
- package/app/utils/locale-path.ts +45 -0
- package/app/utils/navigation-tree.ts +206 -0
- package/app/utils/nearest-page.ts +72 -0
- package/app/utils/openapi.ts +1028 -0
- package/app/utils/package-command.ts +162 -0
- package/app/utils/request-samples.ts +635 -0
- package/app/utils/section-scope.ts +97 -0
- package/app/utils/sheet-navigation.ts +100 -0
- package/app/utils/source-file.ts +84 -0
- package/app/utils/version-choices.ts +68 -0
- package/app/utils/version-paths.ts +65 -0
- package/bin/duxt-report.mjs +45 -0
- package/components.json +19 -0
- package/content-cache.ts +193 -0
- package/content.config.ts +38 -0
- package/duxt-app-config.ts +124 -0
- package/highlight-langs.ts +68 -0
- package/i18n/i18n.config.ts +16 -0
- package/i18n/locales/de/duxt/changelog.json +17 -0
- package/i18n/locales/de/duxt/code.json +13 -0
- package/i18n/locales/de/duxt/defaults.json +22 -0
- package/i18n/locales/de/duxt/devtools.json +7 -0
- package/i18n/locales/de/duxt/error.json +10 -0
- package/i18n/locales/de/duxt/footer.json +7 -0
- package/i18n/locales/de/duxt/locale.json +7 -0
- package/i18n/locales/de/duxt/nav.json +17 -0
- package/i18n/locales/de/duxt/openapi.json +89 -0
- package/i18n/locales/de/duxt/page.json +34 -0
- package/i18n/locales/de/duxt/search.json +12 -0
- package/i18n/locales/de/duxt/shortcuts.json +11 -0
- package/i18n/locales/de/duxt/theme.json +7 -0
- package/i18n/locales/de/duxt/toc.json +7 -0
- package/i18n/locales/de/duxt/version.json +25 -0
- package/i18n/locales/en/duxt/changelog.json +17 -0
- package/i18n/locales/en/duxt/code.json +13 -0
- package/i18n/locales/en/duxt/defaults.json +22 -0
- package/i18n/locales/en/duxt/devtools.json +7 -0
- package/i18n/locales/en/duxt/error.json +10 -0
- package/i18n/locales/en/duxt/footer.json +7 -0
- package/i18n/locales/en/duxt/locale.json +7 -0
- package/i18n/locales/en/duxt/nav.json +17 -0
- package/i18n/locales/en/duxt/openapi.json +89 -0
- package/i18n/locales/en/duxt/page.json +34 -0
- package/i18n/locales/en/duxt/search.json +12 -0
- package/i18n/locales/en/duxt/shortcuts.json +11 -0
- package/i18n/locales/en/duxt/theme.json +7 -0
- package/i18n/locales/en/duxt/toc.json +7 -0
- package/i18n/locales/en/duxt/version.json +25 -0
- package/i18n/locales/es/duxt/changelog.json +17 -0
- package/i18n/locales/es/duxt/code.json +13 -0
- package/i18n/locales/es/duxt/defaults.json +22 -0
- package/i18n/locales/es/duxt/devtools.json +7 -0
- package/i18n/locales/es/duxt/error.json +10 -0
- package/i18n/locales/es/duxt/footer.json +7 -0
- package/i18n/locales/es/duxt/locale.json +7 -0
- package/i18n/locales/es/duxt/nav.json +17 -0
- package/i18n/locales/es/duxt/openapi.json +89 -0
- package/i18n/locales/es/duxt/page.json +34 -0
- package/i18n/locales/es/duxt/search.json +12 -0
- package/i18n/locales/es/duxt/shortcuts.json +11 -0
- package/i18n/locales/es/duxt/theme.json +7 -0
- package/i18n/locales/es/duxt/toc.json +7 -0
- package/i18n/locales/es/duxt/version.json +25 -0
- package/i18n/locales/fr/duxt/changelog.json +17 -0
- package/i18n/locales/fr/duxt/code.json +13 -0
- package/i18n/locales/fr/duxt/defaults.json +22 -0
- package/i18n/locales/fr/duxt/devtools.json +7 -0
- package/i18n/locales/fr/duxt/error.json +10 -0
- package/i18n/locales/fr/duxt/footer.json +7 -0
- package/i18n/locales/fr/duxt/locale.json +7 -0
- package/i18n/locales/fr/duxt/nav.json +17 -0
- package/i18n/locales/fr/duxt/openapi.json +89 -0
- package/i18n/locales/fr/duxt/page.json +34 -0
- package/i18n/locales/fr/duxt/search.json +12 -0
- package/i18n/locales/fr/duxt/shortcuts.json +11 -0
- package/i18n/locales/fr/duxt/theme.json +7 -0
- package/i18n/locales/fr/duxt/toc.json +7 -0
- package/i18n/locales/fr/duxt/version.json +25 -0
- package/i18n/locales/pt/duxt/changelog.json +17 -0
- package/i18n/locales/pt/duxt/code.json +13 -0
- package/i18n/locales/pt/duxt/defaults.json +22 -0
- package/i18n/locales/pt/duxt/devtools.json +7 -0
- package/i18n/locales/pt/duxt/error.json +10 -0
- package/i18n/locales/pt/duxt/footer.json +7 -0
- package/i18n/locales/pt/duxt/locale.json +7 -0
- package/i18n/locales/pt/duxt/nav.json +17 -0
- package/i18n/locales/pt/duxt/openapi.json +89 -0
- package/i18n/locales/pt/duxt/page.json +34 -0
- package/i18n/locales/pt/duxt/search.json +12 -0
- package/i18n/locales/pt/duxt/shortcuts.json +11 -0
- package/i18n/locales/pt/duxt/theme.json +7 -0
- package/i18n/locales/pt/duxt/toc.json +7 -0
- package/i18n/locales/pt/duxt/version.json +25 -0
- package/i18n/locales/pt-BR/duxt/error.json +8 -0
- package/i18n/locales/pt-BR/duxt/nav.json +10 -0
- package/i18n/locales/pt-BR/duxt/page.json +10 -0
- package/i18n/locales/pt-BR/duxt/search.json +11 -0
- package/i18n/locales/pt-BR/duxt/version.json +13 -0
- package/mdc.config.ts +28 -0
- package/modules/config.ts +440 -0
- package/modules/devtools.ts +126 -0
- package/modules/git-meta.ts +349 -0
- package/modules/redirects.ts +152 -0
- package/modules/validate.ts +137 -0
- package/nuxt.config.ts +530 -0
- package/openapi-model.ts +358 -0
- package/openapi-parse.ts +1052 -0
- package/package.json +161 -0
- package/public/devtools/cache.html +318 -0
- package/public/devtools/checks.html +309 -0
- package/public/devtools/config.html +461 -0
- package/public/devtools/i18n.html +309 -0
- package/public/devtools/pages.html +348 -0
- package/public/devtools/paths.html +315 -0
- package/public/devtools/redirects.html +309 -0
- package/public/devtools/search.html +324 -0
- package/public/devtools/sources.html +309 -0
- package/public/devtools/versions.html +318 -0
- package/report.ts +303 -0
- package/repository-root.ts +26 -0
- package/section-reports.ts +55 -0
- package/sections-changelog.ts +644 -0
- package/sections-openapi.ts +450 -0
- package/sections-resolve.ts +711 -0
- package/sections.ts +157 -0
- package/server/devtools/content.ts +120 -0
- package/server/devtools/context.ts +38 -0
- package/server/devtools/entry-path.ts +30 -0
- package/server/devtools/handler.ts +104 -0
- package/server/devtools/preview.ts +461 -0
- package/server/devtools/render/content.ts +233 -0
- package/server/devtools/render/sources.ts +414 -0
- package/server/devtools/render/system.ts +352 -0
- package/server/devtools/shell.ts +611 -0
- package/server/devtools/sources.ts +122 -0
- package/server/devtools/system.ts +178 -0
- package/server/mcp/tools/list-pages.ts +52 -0
- package/server/mcp/tools/read-page.ts +57 -0
- package/server/mcp/tools/search-docs.ts +74 -0
- package/server/middleware/raw-markdown.ts +86 -0
- package/server/routes/llms-full.txt.get.ts +75 -0
- package/server/routes/llms.txt.get.ts +63 -0
- package/server/routes/rss.xml.get.ts +125 -0
- package/server/utils/duxt-server-text.ts +46 -0
- package/sources-git.ts +113 -0
- package/sources-resolve.ts +908 -0
- package/sources.ts +287 -0
- package/validate-report.ts +494 -0
package/openapi-model.ts
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape an OpenAPI document is read into — types only, and no imports.
|
|
3
|
+
*
|
|
4
|
+
* Split from `openapi-parse.ts` for the reason `sources-resolve.ts` is split
|
|
5
|
+
* from `sources.ts`, one step further down: the PARSER imports a YAML reader,
|
|
6
|
+
* and the theme's components need the model without it. A file with no imports
|
|
7
|
+
* at all can be read from either side — the build, the tests and a `.vue` file
|
|
8
|
+
* in the browser bundle — and there is then no way for a value import to drag
|
|
9
|
+
* a parser into the client by accident.
|
|
10
|
+
*
|
|
11
|
+
* ONE SPELLING FOR TWO DIALECTS. 3.0 and 3.1 say the same things differently:
|
|
12
|
+
* `nullable: true` against a `null` in the type list, a boolean
|
|
13
|
+
* `exclusiveMinimum` against a numeric one, a singular `example` against a
|
|
14
|
+
* list. Every one of those is reduced by the parser to the 3.1 spelling before
|
|
15
|
+
* it reaches this model, so nothing that renders a schema branches on the
|
|
16
|
+
* version of the document it came from.
|
|
17
|
+
*
|
|
18
|
+
* EMPTY IS ABSENT, everywhere but one place. `compactOpenApi` runs over the
|
|
19
|
+
* parser's own result, so a list with nothing in it and a map with no keys are
|
|
20
|
+
* dropped rather than carried — which is why so many collections here are
|
|
21
|
+
* optional. That is not defensive typing: it is the shape the model actually
|
|
22
|
+
* has, in the tests, in the props a page writes and in the components that read
|
|
23
|
+
* them, and a required field the payload does not carry would be a lie the
|
|
24
|
+
* compiler could not catch. The exception is `security`, where an empty list is
|
|
25
|
+
* an operation saying it needs no authentication at all — see `KEEP` in
|
|
26
|
+
* `openapi-parse.ts`.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/** A server the API is reachable at, variables unexpanded. */
|
|
30
|
+
export interface DuxtOpenApiServer {
|
|
31
|
+
url: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
variables?: DuxtOpenApiServerVariable[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface DuxtOpenApiServerVariable {
|
|
37
|
+
name: string;
|
|
38
|
+
default?: string;
|
|
39
|
+
enum?: string[];
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** One named example, from `examples` or promoted out of a singular `example`. */
|
|
44
|
+
export interface DuxtOpenApiExample {
|
|
45
|
+
name: string;
|
|
46
|
+
summary?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
value?: unknown;
|
|
49
|
+
/** An example the document points at rather than carries. */
|
|
50
|
+
externalValue?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The constraint keywords, gathered so a renderer draws them in one row. */
|
|
54
|
+
export interface DuxtOpenApiConstraints {
|
|
55
|
+
minimum?: number;
|
|
56
|
+
maximum?: number;
|
|
57
|
+
exclusiveMinimum?: number;
|
|
58
|
+
exclusiveMaximum?: number;
|
|
59
|
+
multipleOf?: number;
|
|
60
|
+
minLength?: number;
|
|
61
|
+
maxLength?: number;
|
|
62
|
+
pattern?: string;
|
|
63
|
+
minItems?: number;
|
|
64
|
+
maxItems?: number;
|
|
65
|
+
uniqueItems?: boolean;
|
|
66
|
+
minProperties?: number;
|
|
67
|
+
maxProperties?: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** One property of an object schema. */
|
|
71
|
+
export interface DuxtOpenApiProperty {
|
|
72
|
+
name: string;
|
|
73
|
+
required: boolean;
|
|
74
|
+
schema: DuxtOpenApiSchema;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A schema, in ONE spelling.
|
|
79
|
+
*
|
|
80
|
+
* `types` is always a list, because 3.1 allows one and 3.0's `nullable` is the
|
|
81
|
+
* same statement written differently — normalising here is what keeps
|
|
82
|
+
* `nullable` out of every component that draws a type.
|
|
83
|
+
*/
|
|
84
|
+
export interface DuxtOpenApiSchema {
|
|
85
|
+
/** The component name this came through, when it came through a `$ref`. */
|
|
86
|
+
name?: string;
|
|
87
|
+
/** The `$ref` this schema stands for, when the reference was not followed. */
|
|
88
|
+
ref?: string;
|
|
89
|
+
/** True when following the reference again would loop. */
|
|
90
|
+
circular?: boolean;
|
|
91
|
+
/** True when the reference leaves this document and cannot be followed. */
|
|
92
|
+
external?: boolean;
|
|
93
|
+
types?: string[];
|
|
94
|
+
format?: string;
|
|
95
|
+
title?: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
default?: unknown;
|
|
98
|
+
const?: unknown;
|
|
99
|
+
enum?: unknown[];
|
|
100
|
+
examples?: unknown[];
|
|
101
|
+
deprecated?: boolean;
|
|
102
|
+
readOnly?: boolean;
|
|
103
|
+
writeOnly?: boolean;
|
|
104
|
+
constraints?: DuxtOpenApiConstraints;
|
|
105
|
+
properties?: DuxtOpenApiProperty[];
|
|
106
|
+
/** `false` forbids further properties; a schema constrains them. */
|
|
107
|
+
additionalProperties?: DuxtOpenApiSchema | false;
|
|
108
|
+
items?: DuxtOpenApiSchema;
|
|
109
|
+
/** 3.1's positional array schemas. */
|
|
110
|
+
prefixItems?: DuxtOpenApiSchema[];
|
|
111
|
+
oneOf?: DuxtOpenApiSchema[];
|
|
112
|
+
anyOf?: DuxtOpenApiSchema[];
|
|
113
|
+
/** Only what could NOT be merged — see `mergeAllOf`. */
|
|
114
|
+
allOf?: DuxtOpenApiSchema[];
|
|
115
|
+
not?: DuxtOpenApiSchema;
|
|
116
|
+
discriminator?: { propertyName: string; mapping?: Record<string, string> };
|
|
117
|
+
externalDocs?: DuxtOpenApiExternalDocs;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface DuxtOpenApiExternalDocs {
|
|
121
|
+
url: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface DuxtOpenApiParameter {
|
|
126
|
+
name: string;
|
|
127
|
+
in: 'path' | 'query' | 'header' | 'cookie';
|
|
128
|
+
description?: string;
|
|
129
|
+
required: boolean;
|
|
130
|
+
deprecated?: boolean;
|
|
131
|
+
allowEmptyValue?: boolean;
|
|
132
|
+
style?: string;
|
|
133
|
+
explode?: boolean;
|
|
134
|
+
schema?: DuxtOpenApiSchema;
|
|
135
|
+
examples?: DuxtOpenApiExample[];
|
|
136
|
+
/** A parameter serialised as a body rather than a scalar. */
|
|
137
|
+
content?: DuxtOpenApiMediaType[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface DuxtOpenApiMediaType {
|
|
141
|
+
/** The media type itself, e.g. `application/json`. */
|
|
142
|
+
type: string;
|
|
143
|
+
schema?: DuxtOpenApiSchema;
|
|
144
|
+
examples?: DuxtOpenApiExample[];
|
|
145
|
+
encoding?: DuxtOpenApiEncoding[];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface DuxtOpenApiEncoding {
|
|
149
|
+
property: string;
|
|
150
|
+
contentType?: string;
|
|
151
|
+
style?: string;
|
|
152
|
+
explode?: boolean;
|
|
153
|
+
allowReserved?: boolean;
|
|
154
|
+
headers?: DuxtOpenApiHeader[];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface DuxtOpenApiHeader {
|
|
158
|
+
name: string;
|
|
159
|
+
description?: string;
|
|
160
|
+
required: boolean;
|
|
161
|
+
deprecated?: boolean;
|
|
162
|
+
schema?: DuxtOpenApiSchema;
|
|
163
|
+
examples?: DuxtOpenApiExample[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface DuxtOpenApiBody {
|
|
167
|
+
description?: string;
|
|
168
|
+
required: boolean;
|
|
169
|
+
content?: DuxtOpenApiMediaType[];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface DuxtOpenApiLink {
|
|
173
|
+
name: string;
|
|
174
|
+
operationId?: string;
|
|
175
|
+
operationRef?: string;
|
|
176
|
+
description?: string;
|
|
177
|
+
parameters?: Record<string, unknown>;
|
|
178
|
+
requestBody?: unknown;
|
|
179
|
+
server?: DuxtOpenApiServer;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface DuxtOpenApiResponse {
|
|
183
|
+
/** A status code, a wildcard like `4XX`, or `default`. */
|
|
184
|
+
status: string;
|
|
185
|
+
description?: string;
|
|
186
|
+
headers?: DuxtOpenApiHeader[];
|
|
187
|
+
content?: DuxtOpenApiMediaType[];
|
|
188
|
+
links?: DuxtOpenApiLink[];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export type DuxtOpenApiSecuritySchemeType =
|
|
192
|
+
| 'apiKey'
|
|
193
|
+
| 'http'
|
|
194
|
+
| 'oauth2'
|
|
195
|
+
| 'openIdConnect'
|
|
196
|
+
| 'mutualTLS';
|
|
197
|
+
|
|
198
|
+
export interface DuxtOpenApiOAuthFlow {
|
|
199
|
+
/** `authorizationCode`, `implicit`, `password` or `clientCredentials`. */
|
|
200
|
+
name: string;
|
|
201
|
+
authorizationUrl?: string;
|
|
202
|
+
tokenUrl?: string;
|
|
203
|
+
refreshUrl?: string;
|
|
204
|
+
scopes?: { name: string; description?: string }[];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface DuxtOpenApiSecurityScheme {
|
|
208
|
+
/** The key it is declared under in `components.securitySchemes`. */
|
|
209
|
+
key: string;
|
|
210
|
+
type: DuxtOpenApiSecuritySchemeType;
|
|
211
|
+
description?: string;
|
|
212
|
+
/** `apiKey`: the parameter name and where it goes. */
|
|
213
|
+
name?: string;
|
|
214
|
+
in?: 'query' | 'header' | 'cookie';
|
|
215
|
+
/** `http`: the authentication scheme, e.g. `bearer` or `basic`. */
|
|
216
|
+
scheme?: string;
|
|
217
|
+
/**
|
|
218
|
+
* A value the try-it client fills the field with, from `x-duxt-example`.
|
|
219
|
+
*
|
|
220
|
+
* An EXTENSION, because OpenAPI has no field for it: a security scheme
|
|
221
|
+
* describes where a credential goes, never what one looks like. A demo
|
|
222
|
+
* endpoint that answers to any token — or to one known token — can say so
|
|
223
|
+
* here, and a reader presses Send without first inventing a value.
|
|
224
|
+
*
|
|
225
|
+
* A published document, so this is a value that may be public and nothing
|
|
226
|
+
* else. Real credentials belong nowhere near a spec file.
|
|
227
|
+
*/
|
|
228
|
+
example?: string;
|
|
229
|
+
bearerFormat?: string;
|
|
230
|
+
flows?: DuxtOpenApiOAuthFlow[];
|
|
231
|
+
openIdConnectUrl?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** One scheme inside an alternative, with the scopes that alternative asks for. */
|
|
235
|
+
export interface DuxtOpenApiSecurityRequirement {
|
|
236
|
+
key: string;
|
|
237
|
+
scopes?: string[];
|
|
238
|
+
scheme?: DuxtOpenApiSecurityScheme;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* The security a request must satisfy: alternatives of conjunctions.
|
|
243
|
+
*
|
|
244
|
+
* `security` is a LIST of objects, and the two levels mean different things —
|
|
245
|
+
* any one entry suffices, and every scheme inside one entry is required. An
|
|
246
|
+
* empty inner list is the document saying "no authentication", which is how an
|
|
247
|
+
* operation opts out of a global requirement.
|
|
248
|
+
*/
|
|
249
|
+
export type DuxtOpenApiSecurity = DuxtOpenApiSecurityRequirement[][];
|
|
250
|
+
|
|
251
|
+
export interface DuxtOpenApiCallbackOperation {
|
|
252
|
+
/** The runtime expression the callback is sent to. */
|
|
253
|
+
expression: string;
|
|
254
|
+
method: string;
|
|
255
|
+
summary?: string;
|
|
256
|
+
description?: string;
|
|
257
|
+
requestBody?: DuxtOpenApiBody;
|
|
258
|
+
responses?: DuxtOpenApiResponse[];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface DuxtOpenApiCallback {
|
|
262
|
+
name: string;
|
|
263
|
+
operations?: DuxtOpenApiCallbackOperation[];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface DuxtOpenApiOperation {
|
|
267
|
+
/**
|
|
268
|
+
* A path operation or a 3.1 webhook.
|
|
269
|
+
*
|
|
270
|
+
* A webhook is the same object under a name instead of a URL — the reader is
|
|
271
|
+
* the server rather than the client — so it renders through the same page and
|
|
272
|
+
* says which it is rather than getting a shape of its own.
|
|
273
|
+
*/
|
|
274
|
+
kind: 'operation' | 'webhook';
|
|
275
|
+
method: string;
|
|
276
|
+
/** The path template, or — for a webhook — the name it is declared under. */
|
|
277
|
+
path: string;
|
|
278
|
+
operationId?: string;
|
|
279
|
+
summary?: string;
|
|
280
|
+
description?: string;
|
|
281
|
+
deprecated: boolean;
|
|
282
|
+
tags?: string[];
|
|
283
|
+
externalDocs?: DuxtOpenApiExternalDocs;
|
|
284
|
+
servers?: DuxtOpenApiServer[];
|
|
285
|
+
/** Absent when the operation inherits the document's own requirement. */
|
|
286
|
+
security?: DuxtOpenApiSecurity;
|
|
287
|
+
parameters?: DuxtOpenApiParameter[];
|
|
288
|
+
requestBody?: DuxtOpenApiBody;
|
|
289
|
+
responses?: DuxtOpenApiResponse[];
|
|
290
|
+
callbacks?: DuxtOpenApiCallback[];
|
|
291
|
+
/**
|
|
292
|
+
* Samples the API's own author wrote, from `x-codeSamples`.
|
|
293
|
+
*
|
|
294
|
+
* The extension is Redocly's and is what an OpenAPI document already carries
|
|
295
|
+
* where somebody has written samples by hand. They are STATIC — they cannot
|
|
296
|
+
* follow the reader's edits in the try-it client — and they are worth showing
|
|
297
|
+
* anyway: the person who owns the API knows its idioms, and a build-time
|
|
298
|
+
* sample is highlighted with the full grammar set and so costs a reader
|
|
299
|
+
* nothing.
|
|
300
|
+
*/
|
|
301
|
+
codeSamples?: DuxtOpenApiCodeSample[];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/** One hand-written sample from `x-codeSamples`. */
|
|
305
|
+
export interface DuxtOpenApiCodeSample {
|
|
306
|
+
/** The `lang` field, used as the Shiki id and as the group's name. */
|
|
307
|
+
lang: string;
|
|
308
|
+
/** The client, where the author named one. */
|
|
309
|
+
label?: string;
|
|
310
|
+
source: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export interface DuxtOpenApiTag {
|
|
314
|
+
name: string;
|
|
315
|
+
description?: string;
|
|
316
|
+
externalDocs?: DuxtOpenApiExternalDocs;
|
|
317
|
+
/** True for the group 3.1 webhooks are collected into. */
|
|
318
|
+
webhooks?: boolean;
|
|
319
|
+
operations?: DuxtOpenApiOperation[];
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface DuxtOpenApiInfo {
|
|
323
|
+
title: string;
|
|
324
|
+
version?: string;
|
|
325
|
+
summary?: string;
|
|
326
|
+
description?: string;
|
|
327
|
+
termsOfService?: string;
|
|
328
|
+
contact?: { name?: string; url?: string; email?: string };
|
|
329
|
+
license?: { name?: string; identifier?: string; url?: string };
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface DuxtOpenApiSpec {
|
|
333
|
+
/** The dialect the document declared, normalised to its minor line. */
|
|
334
|
+
dialect: '3.0' | '3.1';
|
|
335
|
+
info: DuxtOpenApiInfo;
|
|
336
|
+
servers?: DuxtOpenApiServer[];
|
|
337
|
+
externalDocs?: DuxtOpenApiExternalDocs;
|
|
338
|
+
/** The document-wide requirement an operation inherits. */
|
|
339
|
+
security?: DuxtOpenApiSecurity;
|
|
340
|
+
securitySchemes?: DuxtOpenApiSecurityScheme[];
|
|
341
|
+
tags?: DuxtOpenApiTag[];
|
|
342
|
+
/** Everything the reader was not given, in the words the build prints. */
|
|
343
|
+
warnings: string[];
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The groups the layer names when the document does not.
|
|
348
|
+
*
|
|
349
|
+
* Untranslated, and for the same reason a generated section's `label` is a
|
|
350
|
+
* plain string rather than a `DuxtText`: a tag's name is its URL segment, and a
|
|
351
|
+
* translated text is not a stable URL. The alternative — a translated heading
|
|
352
|
+
* over a segment fixed in English — is a page whose address and whose title
|
|
353
|
+
* disagree in six of seven languages.
|
|
354
|
+
*/
|
|
355
|
+
export const DUXT_OPENAPI_DEFAULT_TAG = 'Endpoints';
|
|
356
|
+
|
|
357
|
+
/** The tag 3.1 webhooks are filed under. See above for why it is not translated. */
|
|
358
|
+
export const DUXT_OPENAPI_WEBHOOKS_TAG = 'Webhooks';
|