specra-cli 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MD +33 -0
- package/README.md +246 -0
- package/dist/api-client-VHQARPDT.js +15 -0
- package/dist/api-client-VHQARPDT.js.map +1 -0
- package/dist/chunk-5765WX4D.js +192 -0
- package/dist/chunk-5765WX4D.js.map +1 -0
- package/dist/chunk-72RDEJR2.js +94 -0
- package/dist/chunk-72RDEJR2.js.map +1 -0
- package/dist/chunk-SQ2MMFUZ.js +102 -0
- package/dist/chunk-SQ2MMFUZ.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +242 -0
- package/dist/cli.js.map +1 -0
- package/dist/deploy-V4JO2D6B.js +179 -0
- package/dist/deploy-V4JO2D6B.js.map +1 -0
- package/dist/doctor-ICALAJ4N.js +309 -0
- package/dist/doctor-ICALAJ4N.js.map +1 -0
- package/dist/login-UG3WU7DY.js +92 -0
- package/dist/login-UG3WU7DY.js.map +1 -0
- package/dist/logout-WJKHJZT6.js +24 -0
- package/dist/logout-WJKHJZT6.js.map +1 -0
- package/dist/logs-BLUJPWNO.js +77 -0
- package/dist/logs-BLUJPWNO.js.map +1 -0
- package/dist/projects-LJ57GK3D.js +49 -0
- package/dist/projects-LJ57GK3D.js.map +1 -0
- package/package.json +50 -0
- package/templates/book-docs/.env.sample +1 -0
- package/templates/book-docs/docs/v1.0.0/concepts.mdx +89 -0
- package/templates/book-docs/docs/v1.0.0/content/_category_.json +7 -0
- package/templates/book-docs/docs/v1.0.0/content/formatting.mdx +128 -0
- package/templates/book-docs/docs/v1.0.0/content/reusable-content.mdx +116 -0
- package/templates/book-docs/docs/v1.0.0/content/structure.mdx +92 -0
- package/templates/book-docs/docs/v1.0.0/customization/_category_.json +7 -0
- package/templates/book-docs/docs/v1.0.0/customization/branding.mdx +115 -0
- package/templates/book-docs/docs/v1.0.0/customization/themes.mdx +81 -0
- package/templates/book-docs/docs/v1.0.0/introduction.mdx +38 -0
- package/templates/book-docs/docs/v1.0.0/quickstart.mdx +112 -0
- package/templates/book-docs/docs/v2.0.0/concepts.mdx +89 -0
- package/templates/book-docs/docs/v2.0.0/content/_category_.json +7 -0
- package/templates/book-docs/docs/v2.0.0/content/formatting.mdx +128 -0
- package/templates/book-docs/docs/v2.0.0/content/reusable-content.mdx +116 -0
- package/templates/book-docs/docs/v2.0.0/content/structure.mdx +92 -0
- package/templates/book-docs/docs/v2.0.0/customization/_category_.json +7 -0
- package/templates/book-docs/docs/v2.0.0/customization/branding.mdx +115 -0
- package/templates/book-docs/docs/v2.0.0/customization/themes.mdx +81 -0
- package/templates/book-docs/docs/v2.0.0/introduction.mdx +39 -0
- package/templates/book-docs/docs/v2.0.0/quickstart.mdx +112 -0
- package/templates/book-docs/gitignore +7 -0
- package/templates/book-docs/package.json +28 -0
- package/templates/book-docs/postcss.config.mjs +8 -0
- package/templates/book-docs/public/api-specs/openapi-example.json +259 -0
- package/templates/book-docs/public/api-specs/postman-example.json +205 -0
- package/templates/book-docs/public/api-specs/test-api.json +256 -0
- package/templates/book-docs/public/api-specs/users-api.json +264 -0
- package/templates/book-docs/specra.config.json +77 -0
- package/templates/book-docs/src/app.css +86 -0
- package/templates/book-docs/src/app.html +17 -0
- package/templates/book-docs/src/params/product.ts +7 -0
- package/templates/book-docs/src/routes/+layout.server.ts +14 -0
- package/templates/book-docs/src/routes/+layout.svelte +21 -0
- package/templates/book-docs/src/routes/+page.server.ts +9 -0
- package/templates/book-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
- package/templates/book-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
- package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
- package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
- package/templates/book-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
- package/templates/book-docs/src/routes/docs/[version]/+page.server.ts +27 -0
- package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
- package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
- package/templates/book-docs/static/favicon.svg +4 -0
- package/templates/book-docs/svelte.config.js +13 -0
- package/templates/book-docs/tsconfig.json +12 -0
- package/templates/book-docs/vite.config.ts +6 -0
- package/templates/jbrains-docs/.env.sample +1 -0
- package/templates/jbrains-docs/docs/v1.0.0/advanced/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v1.0.0/advanced/async.mdx +95 -0
- package/templates/jbrains-docs/docs/v1.0.0/advanced/generics.mdx +126 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/control-flow.mdx +106 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/syntax.mdx +129 -0
- package/templates/jbrains-docs/docs/v1.0.0/basics/types.mdx +135 -0
- package/templates/jbrains-docs/docs/v1.0.0/getting-started.mdx +111 -0
- package/templates/jbrains-docs/docs/v1.0.0/home.mdx +37 -0
- package/templates/jbrains-docs/docs/v1.0.0/tools/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v1.0.0/tools/build-tools.mdx +165 -0
- package/templates/jbrains-docs/docs/v1.0.0/tools/testing.mdx +112 -0
- package/templates/jbrains-docs/docs/v2.0.0/advanced/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v2.0.0/advanced/async.mdx +95 -0
- package/templates/jbrains-docs/docs/v2.0.0/advanced/generics.mdx +126 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/control-flow.mdx +106 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/syntax.mdx +129 -0
- package/templates/jbrains-docs/docs/v2.0.0/basics/types.mdx +135 -0
- package/templates/jbrains-docs/docs/v2.0.0/getting-started.mdx +111 -0
- package/templates/jbrains-docs/docs/v2.0.0/home.mdx +37 -0
- package/templates/jbrains-docs/docs/v2.0.0/tools/_category_.json +8 -0
- package/templates/jbrains-docs/docs/v2.0.0/tools/build-tools.mdx +165 -0
- package/templates/jbrains-docs/docs/v2.0.0/tools/testing.mdx +112 -0
- package/templates/jbrains-docs/gitignore +7 -0
- package/templates/jbrains-docs/package.json +28 -0
- package/templates/jbrains-docs/postcss.config.mjs +8 -0
- package/templates/jbrains-docs/public/api-specs/openapi-example.json +259 -0
- package/templates/jbrains-docs/public/api-specs/postman-example.json +205 -0
- package/templates/jbrains-docs/public/api-specs/test-api.json +256 -0
- package/templates/jbrains-docs/public/api-specs/users-api.json +264 -0
- package/templates/jbrains-docs/specra.config.json +80 -0
- package/templates/jbrains-docs/src/app.css +86 -0
- package/templates/jbrains-docs/src/app.html +17 -0
- package/templates/jbrains-docs/src/params/product.ts +7 -0
- package/templates/jbrains-docs/src/routes/+layout.server.ts +14 -0
- package/templates/jbrains-docs/src/routes/+layout.svelte +21 -0
- package/templates/jbrains-docs/src/routes/+page.server.ts +9 -0
- package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
- package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
- package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
- package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/+page.server.ts +27 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
- package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
- package/templates/jbrains-docs/static/favicon.svg +4 -0
- package/templates/jbrains-docs/svelte.config.js +13 -0
- package/templates/jbrains-docs/tsconfig.json +12 -0
- package/templates/jbrains-docs/vite.config.ts +6 -0
- package/templates/minimal/.env.sample +1 -0
- package/templates/minimal/docs/v1.0.0/about.mdx +57 -0
- package/templates/minimal/docs/v1.0.0/components/_category_.json +8 -0
- package/templates/minimal/docs/v1.0.0/components/callout.mdx +83 -0
- package/templates/minimal/docs/v1.0.0/components/code-block.mdx +103 -0
- package/templates/minimal/docs/v1.0.0/components/index.mdx +8 -0
- package/templates/minimal/docs/v1.0.0/components/tabs.mdx +92 -0
- package/templates/minimal/docs/v1.0.0/configuration.mdx +322 -0
- package/templates/minimal/docs/v1.0.0/features.mdx +197 -0
- package/templates/minimal/docs/v1.0.0/getting-started.mdx +183 -0
- package/templates/minimal/docs/v2.0.0/about.mdx +57 -0
- package/templates/minimal/docs/v2.0.0/components/_category_.json +8 -0
- package/templates/minimal/docs/v2.0.0/components/callout.mdx +83 -0
- package/templates/minimal/docs/v2.0.0/components/code-block.mdx +103 -0
- package/templates/minimal/docs/v2.0.0/components/index.mdx +8 -0
- package/templates/minimal/docs/v2.0.0/components/tabs.mdx +92 -0
- package/templates/minimal/docs/v2.0.0/configuration.mdx +322 -0
- package/templates/minimal/docs/v2.0.0/features.mdx +197 -0
- package/templates/minimal/docs/v2.0.0/getting-started.mdx +183 -0
- package/templates/minimal/gitignore +7 -0
- package/templates/minimal/package.json +29 -0
- package/templates/minimal/postcss.config.mjs +8 -0
- package/templates/minimal/specra.config.json +91 -0
- package/templates/minimal/src/app.css +86 -0
- package/templates/minimal/src/app.html +17 -0
- package/templates/minimal/src/hooks.server.ts +8 -0
- package/templates/minimal/src/params/product.ts +7 -0
- package/templates/minimal/src/routes/+error.svelte +10 -0
- package/templates/minimal/src/routes/+layout.server.ts +14 -0
- package/templates/minimal/src/routes/+layout.svelte +21 -0
- package/templates/minimal/src/routes/+page.server.ts +9 -0
- package/templates/minimal/src/routes/+page.svelte +149 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
- package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
- package/templates/minimal/src/routes/docs/[version]/+layout.server.ts +42 -0
- package/templates/minimal/src/routes/docs/[version]/+page.server.ts +27 -0
- package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
- package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
- package/templates/minimal/static/api-specs/openapi-example.json +259 -0
- package/templates/minimal/static/api-specs/postman-example.json +205 -0
- package/templates/minimal/static/api-specs/test-api.json +256 -0
- package/templates/minimal/static/api-specs/users-api.json +264 -0
- package/templates/minimal/static/favicon.svg +4 -0
- package/templates/minimal/svelte.config.js +13 -0
- package/templates/minimal/tsconfig.json +12 -0
- package/templates/minimal/vite.config.ts +6 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extractTableOfContents,
|
|
3
|
+
getAdjacentDocs,
|
|
4
|
+
isCategoryPage,
|
|
5
|
+
getCachedAllDocs,
|
|
6
|
+
getCachedDocBySlug,
|
|
7
|
+
getI18nConfig,
|
|
8
|
+
} from 'specra';
|
|
9
|
+
import type { PageServerLoad } from './$types';
|
|
10
|
+
|
|
11
|
+
export const load: PageServerLoad = async ({ params }) => {
|
|
12
|
+
const { version, slug: slugArray } = params;
|
|
13
|
+
const slug = slugArray.replace(/\/$/, '');
|
|
14
|
+
|
|
15
|
+
const i18nConfig = getI18nConfig();
|
|
16
|
+
const slugParts = slug.split('/');
|
|
17
|
+
let locale: string | undefined;
|
|
18
|
+
if (i18nConfig && i18nConfig.locales.includes(slugParts[0])) {
|
|
19
|
+
locale = slugParts[0];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const allDocs = await getCachedAllDocs(version, locale);
|
|
23
|
+
const isCategory = isCategoryPage(slug, allDocs);
|
|
24
|
+
const doc = await getCachedDocBySlug(slug, version);
|
|
25
|
+
|
|
26
|
+
let title = 'Page Not Found';
|
|
27
|
+
let description = 'The requested documentation page could not be found.';
|
|
28
|
+
let ogUrl = `/docs/${version}/${slug}`;
|
|
29
|
+
|
|
30
|
+
if (doc) {
|
|
31
|
+
title = doc.meta.title || doc.title;
|
|
32
|
+
description = doc.meta.description || `Documentation for ${title}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Category page without doc content
|
|
36
|
+
if (!doc && isCategory) {
|
|
37
|
+
const categoryDoc = allDocs.find((d) => d.slug.startsWith(slug + '/'));
|
|
38
|
+
const categoryTabGroup = categoryDoc?.meta?.tab_group || categoryDoc?.categoryTabGroup;
|
|
39
|
+
const categoryTitle = slug
|
|
40
|
+
.split('/')
|
|
41
|
+
.pop()
|
|
42
|
+
?.replace(/-/g, ' ')
|
|
43
|
+
.replace(/\b\w/g, (l) => l.toUpperCase()) || 'Category';
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
version,
|
|
47
|
+
slug,
|
|
48
|
+
isCategory: true,
|
|
49
|
+
isNotFound: false,
|
|
50
|
+
doc: null,
|
|
51
|
+
categoryTitle,
|
|
52
|
+
categoryDescription: 'Browse the documentation in this section.',
|
|
53
|
+
categoryTabGroup,
|
|
54
|
+
toc: [],
|
|
55
|
+
previous: null,
|
|
56
|
+
next: null,
|
|
57
|
+
title,
|
|
58
|
+
description,
|
|
59
|
+
ogUrl,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Not found
|
|
64
|
+
if (!doc) {
|
|
65
|
+
return {
|
|
66
|
+
version,
|
|
67
|
+
slug,
|
|
68
|
+
isCategory: false,
|
|
69
|
+
isNotFound: true,
|
|
70
|
+
doc: null,
|
|
71
|
+
categoryTitle: null,
|
|
72
|
+
categoryDescription: null,
|
|
73
|
+
categoryTabGroup: undefined,
|
|
74
|
+
toc: [],
|
|
75
|
+
previous: null,
|
|
76
|
+
next: null,
|
|
77
|
+
title,
|
|
78
|
+
description,
|
|
79
|
+
ogUrl,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Normal doc page
|
|
84
|
+
const toc = extractTableOfContents(doc.meta.content || doc.content);
|
|
85
|
+
const { previous, next } = getAdjacentDocs(slug, allDocs);
|
|
86
|
+
const showCategoryIndex = isCategory && !!doc;
|
|
87
|
+
const matchingDoc = allDocs.find((d) => d.slug === slug);
|
|
88
|
+
const currentPageTabGroup = doc.meta?.tab_group || matchingDoc?.categoryTabGroup;
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
version,
|
|
92
|
+
slug,
|
|
93
|
+
isCategory: showCategoryIndex,
|
|
94
|
+
isNotFound: false,
|
|
95
|
+
doc,
|
|
96
|
+
categoryTitle: null,
|
|
97
|
+
categoryDescription: null,
|
|
98
|
+
categoryTabGroup: currentPageTabGroup,
|
|
99
|
+
toc,
|
|
100
|
+
previous: previous ? { title: previous.meta.title, slug: previous.slug } : null,
|
|
101
|
+
next: next ? { title: next.meta.title, slug: next.slug } : null,
|
|
102
|
+
title,
|
|
103
|
+
description,
|
|
104
|
+
ogUrl,
|
|
105
|
+
};
|
|
106
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
TableOfContents,
|
|
4
|
+
Header,
|
|
5
|
+
TabGroups,
|
|
6
|
+
DocLayout,
|
|
7
|
+
CategoryIndex,
|
|
8
|
+
HotReloadIndicator,
|
|
9
|
+
DevModeBadge,
|
|
10
|
+
MdxHotReload,
|
|
11
|
+
MdxContent,
|
|
12
|
+
NotFoundContent,
|
|
13
|
+
SearchHighlight,
|
|
14
|
+
MobileDocLayout,
|
|
15
|
+
mdxComponents,
|
|
16
|
+
} from 'specra/components';
|
|
17
|
+
import type { PageData } from './$types';
|
|
18
|
+
|
|
19
|
+
let { data }: { data: PageData } = $props();
|
|
20
|
+
|
|
21
|
+
let allDocsCompat: any[] = $derived(data.allDocs);
|
|
22
|
+
let previousDoc = $derived(data.previous ?? undefined);
|
|
23
|
+
let nextDoc = $derived(data.next ?? undefined);
|
|
24
|
+
let categoryTitle = $derived(data.categoryTitle ?? undefined);
|
|
25
|
+
let categoryDescription = $derived(data.categoryDescription ?? undefined);
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<svelte:head>
|
|
29
|
+
<title>{data.title}</title>
|
|
30
|
+
<meta name="description" content={data.description} />
|
|
31
|
+
<meta property="og:title" content={data.title} />
|
|
32
|
+
<meta property="og:description" content={data.description} />
|
|
33
|
+
<meta property="og:url" content={data.ogUrl} />
|
|
34
|
+
<meta property="og:site_name" content="Documentation Platform" />
|
|
35
|
+
<meta property="og:type" content="article" />
|
|
36
|
+
<meta property="og:locale" content="en_US" />
|
|
37
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
38
|
+
<meta name="twitter:title" content={data.title} />
|
|
39
|
+
<meta name="twitter:description" content={data.description} />
|
|
40
|
+
<link rel="canonical" href={data.ogUrl} />
|
|
41
|
+
</svelte:head>
|
|
42
|
+
|
|
43
|
+
{#if !data.doc && data.isCategory}
|
|
44
|
+
<!-- Category page without doc content -->
|
|
45
|
+
<MobileDocLayout
|
|
46
|
+
docs={allDocsCompat}
|
|
47
|
+
version={data.version}
|
|
48
|
+
config={data.config}
|
|
49
|
+
activeTabGroup={data.categoryTabGroup}
|
|
50
|
+
>
|
|
51
|
+
{#snippet header()}
|
|
52
|
+
<Header currentVersion={data.version} versions={data.versions} versionsMeta={data.versionsMeta} versionBanner={data.versionBanner} config={data.config} products={data.products}>
|
|
53
|
+
{#snippet subheader()}
|
|
54
|
+
{#if data.config.navigation?.tabGroups && data.config.navigation.tabGroups.length > 0}
|
|
55
|
+
<TabGroups
|
|
56
|
+
tabGroups={data.config.navigation.tabGroups}
|
|
57
|
+
activeTabId={data.categoryTabGroup}
|
|
58
|
+
docs={allDocsCompat}
|
|
59
|
+
version={data.version}
|
|
60
|
+
flush={data.config.navigation?.sidebarStyle === 'flush'}
|
|
61
|
+
/>
|
|
62
|
+
{/if}
|
|
63
|
+
{/snippet}
|
|
64
|
+
</Header>
|
|
65
|
+
{/snippet}
|
|
66
|
+
<CategoryIndex
|
|
67
|
+
categoryPath={data.slug}
|
|
68
|
+
version={data.version}
|
|
69
|
+
allDocs={allDocsCompat}
|
|
70
|
+
title={categoryTitle}
|
|
71
|
+
description={categoryDescription}
|
|
72
|
+
config={data.config}
|
|
73
|
+
/>
|
|
74
|
+
</MobileDocLayout>
|
|
75
|
+
<MdxHotReload />
|
|
76
|
+
<HotReloadIndicator />
|
|
77
|
+
<DevModeBadge />
|
|
78
|
+
{:else if data.isNotFound}
|
|
79
|
+
<!-- Not found -->
|
|
80
|
+
<MobileDocLayout
|
|
81
|
+
docs={allDocsCompat}
|
|
82
|
+
version={data.version}
|
|
83
|
+
config={data.config}
|
|
84
|
+
>
|
|
85
|
+
{#snippet header()}
|
|
86
|
+
<Header currentVersion={data.version} versions={data.versions} versionsMeta={data.versionsMeta} versionBanner={data.versionBanner} config={data.config} products={data.products}>
|
|
87
|
+
{#snippet subheader()}
|
|
88
|
+
{#if data.config.navigation?.tabGroups && data.config.navigation.tabGroups.length > 0}
|
|
89
|
+
<TabGroups
|
|
90
|
+
tabGroups={data.config.navigation.tabGroups}
|
|
91
|
+
activeTabId={data.categoryTabGroup}
|
|
92
|
+
docs={allDocsCompat}
|
|
93
|
+
version={data.version}
|
|
94
|
+
flush={data.config.navigation?.sidebarStyle === 'flush'}
|
|
95
|
+
/>
|
|
96
|
+
{/if}
|
|
97
|
+
{/snippet}
|
|
98
|
+
</Header>
|
|
99
|
+
{/snippet}
|
|
100
|
+
<NotFoundContent version={data.version} />
|
|
101
|
+
</MobileDocLayout>
|
|
102
|
+
<MdxHotReload />
|
|
103
|
+
<HotReloadIndicator />
|
|
104
|
+
<DevModeBadge />
|
|
105
|
+
{:else if data.doc}
|
|
106
|
+
<!-- Normal doc or category with doc content -->
|
|
107
|
+
<MobileDocLayout
|
|
108
|
+
docs={allDocsCompat}
|
|
109
|
+
version={data.version}
|
|
110
|
+
config={data.config}
|
|
111
|
+
activeTabGroup={data.categoryTabGroup}
|
|
112
|
+
>
|
|
113
|
+
{#snippet header()}
|
|
114
|
+
<Header currentVersion={data.version} versions={data.versions} versionsMeta={data.versionsMeta} versionBanner={data.versionBanner} config={data.config} products={data.products}>
|
|
115
|
+
{#snippet subheader()}
|
|
116
|
+
{#if data.config.navigation?.tabGroups && data.config.navigation.tabGroups.length > 0}
|
|
117
|
+
<TabGroups
|
|
118
|
+
tabGroups={data.config.navigation.tabGroups}
|
|
119
|
+
activeTabId={data.categoryTabGroup}
|
|
120
|
+
docs={allDocsCompat}
|
|
121
|
+
version={data.version}
|
|
122
|
+
flush={data.config.navigation?.sidebarStyle === 'flush'}
|
|
123
|
+
/>
|
|
124
|
+
{/if}
|
|
125
|
+
{/snippet}
|
|
126
|
+
</Header>
|
|
127
|
+
{/snippet}
|
|
128
|
+
{#snippet toc()}
|
|
129
|
+
{#if !data.isCategory}
|
|
130
|
+
<TableOfContents items={data.toc} config={data.config} />
|
|
131
|
+
{/if}
|
|
132
|
+
{/snippet}
|
|
133
|
+
|
|
134
|
+
{#if data.isCategory}
|
|
135
|
+
{#snippet categoryContent()}
|
|
136
|
+
{#if data.doc?.contentNodes}
|
|
137
|
+
<MdxContent nodes={data.doc.contentNodes} components={mdxComponents} />
|
|
138
|
+
{:else if data.doc?.content}
|
|
139
|
+
{@html data.doc.content}
|
|
140
|
+
{/if}
|
|
141
|
+
{/snippet}
|
|
142
|
+
<CategoryIndex
|
|
143
|
+
categoryPath={data.slug}
|
|
144
|
+
version={data.version}
|
|
145
|
+
allDocs={allDocsCompat}
|
|
146
|
+
title={data.doc.meta.title}
|
|
147
|
+
description={data.doc.meta.description}
|
|
148
|
+
content={categoryContent}
|
|
149
|
+
config={data.config}
|
|
150
|
+
/>
|
|
151
|
+
{:else}
|
|
152
|
+
<SearchHighlight />
|
|
153
|
+
<DocLayout
|
|
154
|
+
meta={data.doc.meta}
|
|
155
|
+
previousDoc={previousDoc}
|
|
156
|
+
nextDoc={nextDoc}
|
|
157
|
+
version={data.version}
|
|
158
|
+
slug={data.slug}
|
|
159
|
+
config={data.config}
|
|
160
|
+
>
|
|
161
|
+
{#if data.doc.contentNodes}
|
|
162
|
+
<MdxContent nodes={data.doc.contentNodes} components={mdxComponents} />
|
|
163
|
+
{:else}
|
|
164
|
+
{@html data.doc.content}
|
|
165
|
+
{/if}
|
|
166
|
+
</DocLayout>
|
|
167
|
+
{/if}
|
|
168
|
+
</MobileDocLayout>
|
|
169
|
+
<MdxHotReload />
|
|
170
|
+
<HotReloadIndicator />
|
|
171
|
+
<DevModeBadge />
|
|
172
|
+
{/if}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "User Management API",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "A simple API for managing users (OpenAPI format example)"
|
|
7
|
+
},
|
|
8
|
+
"servers": [
|
|
9
|
+
{
|
|
10
|
+
"url": "https://api.example.com/v1",
|
|
11
|
+
"description": "Production server"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"components": {
|
|
15
|
+
"securitySchemes": {
|
|
16
|
+
"bearerAuth": {
|
|
17
|
+
"type": "http",
|
|
18
|
+
"scheme": "bearer",
|
|
19
|
+
"description": "JWT Bearer token authentication"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"schemas": {
|
|
23
|
+
"User": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"properties": {
|
|
26
|
+
"id": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"example": "user_123"
|
|
29
|
+
},
|
|
30
|
+
"name": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"example": "John Doe"
|
|
33
|
+
},
|
|
34
|
+
"email": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"format": "email",
|
|
37
|
+
"example": "john@example.com"
|
|
38
|
+
},
|
|
39
|
+
"createdAt": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "date-time",
|
|
42
|
+
"example": "2024-01-15T10:30:00Z"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"Error": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"error": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
},
|
|
52
|
+
"code": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"security": [
|
|
60
|
+
{
|
|
61
|
+
"bearerAuth": []
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"paths": {
|
|
65
|
+
"/users": {
|
|
66
|
+
"get": {
|
|
67
|
+
"summary": "List all users",
|
|
68
|
+
"description": "Retrieve a paginated list of all users",
|
|
69
|
+
"operationId": "listUsers",
|
|
70
|
+
"parameters": [
|
|
71
|
+
{
|
|
72
|
+
"name": "page",
|
|
73
|
+
"in": "query",
|
|
74
|
+
"description": "Page number for pagination",
|
|
75
|
+
"schema": {
|
|
76
|
+
"type": "integer",
|
|
77
|
+
"default": 1,
|
|
78
|
+
"example": 1
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "limit",
|
|
83
|
+
"in": "query",
|
|
84
|
+
"description": "Number of items per page",
|
|
85
|
+
"schema": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"default": 10,
|
|
88
|
+
"example": 10
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"responses": {
|
|
93
|
+
"200": {
|
|
94
|
+
"description": "List of users retrieved successfully",
|
|
95
|
+
"content": {
|
|
96
|
+
"application/json": {
|
|
97
|
+
"schema": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": {
|
|
100
|
+
"$ref": "#/components/schemas/User"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"example": [
|
|
104
|
+
{
|
|
105
|
+
"id": "user_123",
|
|
106
|
+
"name": "John Doe",
|
|
107
|
+
"email": "john@example.com",
|
|
108
|
+
"createdAt": "2024-01-15T10:30:00Z"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "user_456",
|
|
112
|
+
"name": "Jane Smith",
|
|
113
|
+
"email": "jane@example.com",
|
|
114
|
+
"createdAt": "2024-01-16T14:20:00Z"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"post": {
|
|
123
|
+
"summary": "Create a new user",
|
|
124
|
+
"description": "Create a new user account",
|
|
125
|
+
"operationId": "createUser",
|
|
126
|
+
"requestBody": {
|
|
127
|
+
"description": "User data to create",
|
|
128
|
+
"required": true,
|
|
129
|
+
"content": {
|
|
130
|
+
"application/json": {
|
|
131
|
+
"schema": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"required": ["name", "email"],
|
|
134
|
+
"properties": {
|
|
135
|
+
"name": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"example": "John Doe"
|
|
138
|
+
},
|
|
139
|
+
"email": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"format": "email",
|
|
142
|
+
"example": "john@example.com"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"responses": {
|
|
150
|
+
"201": {
|
|
151
|
+
"description": "User created successfully",
|
|
152
|
+
"content": {
|
|
153
|
+
"application/json": {
|
|
154
|
+
"schema": {
|
|
155
|
+
"$ref": "#/components/schemas/User"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"400": {
|
|
161
|
+
"description": "Invalid request data",
|
|
162
|
+
"content": {
|
|
163
|
+
"application/json": {
|
|
164
|
+
"schema": {
|
|
165
|
+
"$ref": "#/components/schemas/Error"
|
|
166
|
+
},
|
|
167
|
+
"example": {
|
|
168
|
+
"error": "Email already exists",
|
|
169
|
+
"code": "DUPLICATE_EMAIL"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"/users/{id}": {
|
|
178
|
+
"get": {
|
|
179
|
+
"summary": "Get user by ID",
|
|
180
|
+
"description": "Retrieve a single user by their unique identifier",
|
|
181
|
+
"operationId": "getUserById",
|
|
182
|
+
"parameters": [
|
|
183
|
+
{
|
|
184
|
+
"name": "id",
|
|
185
|
+
"in": "path",
|
|
186
|
+
"required": true,
|
|
187
|
+
"description": "The user's unique identifier",
|
|
188
|
+
"schema": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"example": "user_123"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"responses": {
|
|
195
|
+
"200": {
|
|
196
|
+
"description": "User retrieved successfully",
|
|
197
|
+
"content": {
|
|
198
|
+
"application/json": {
|
|
199
|
+
"schema": {
|
|
200
|
+
"$ref": "#/components/schemas/User"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"404": {
|
|
206
|
+
"description": "User not found",
|
|
207
|
+
"content": {
|
|
208
|
+
"application/json": {
|
|
209
|
+
"schema": {
|
|
210
|
+
"$ref": "#/components/schemas/Error"
|
|
211
|
+
},
|
|
212
|
+
"example": {
|
|
213
|
+
"error": "User not found",
|
|
214
|
+
"code": "USER_NOT_FOUND"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"delete": {
|
|
222
|
+
"summary": "Delete a user",
|
|
223
|
+
"description": "Permanently delete a user account",
|
|
224
|
+
"operationId": "deleteUser",
|
|
225
|
+
"parameters": [
|
|
226
|
+
{
|
|
227
|
+
"name": "id",
|
|
228
|
+
"in": "path",
|
|
229
|
+
"required": true,
|
|
230
|
+
"description": "The user's unique identifier",
|
|
231
|
+
"schema": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"example": "user_123"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"responses": {
|
|
238
|
+
"204": {
|
|
239
|
+
"description": "User deleted successfully"
|
|
240
|
+
},
|
|
241
|
+
"404": {
|
|
242
|
+
"description": "User not found",
|
|
243
|
+
"content": {
|
|
244
|
+
"application/json": {
|
|
245
|
+
"schema": {
|
|
246
|
+
"$ref": "#/components/schemas/Error"
|
|
247
|
+
},
|
|
248
|
+
"example": {
|
|
249
|
+
"error": "User not found",
|
|
250
|
+
"code": "USER_NOT_FOUND"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|