@blaaiz/docs-core 0.3.0 → 0.4.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/dist/{chunk-ICDBGTIJ.js → chunk-JHN5XQPU.js} +97 -44
- package/dist/chunk-JHN5XQPU.js.map +1 -0
- package/dist/generator.cjs +114 -44
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +20 -3
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +95 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -7
- package/dist/index.d.ts +35 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ICDBGTIJ.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -617,15 +617,33 @@ interface PlannedApiPage {
|
|
|
617
617
|
/** Position within the group. */
|
|
618
618
|
readonly order: number;
|
|
619
619
|
}
|
|
620
|
+
/**
|
|
621
|
+
* A child folder of a planned API group, at its position among the group's
|
|
622
|
+
* pages. The generator merges these with the resolved page slugs to write the
|
|
623
|
+
* group's `meta.json` in declared order.
|
|
624
|
+
*
|
|
625
|
+
* @public
|
|
626
|
+
*/
|
|
627
|
+
interface PlannedGroupChild {
|
|
628
|
+
readonly order: number;
|
|
629
|
+
/** The child folder's name within the group directory. */
|
|
630
|
+
readonly folder: string;
|
|
631
|
+
}
|
|
620
632
|
/**
|
|
621
633
|
* A planned API group folder. The generator fills its page order once the
|
|
622
|
-
* operation slugs are known
|
|
634
|
+
* operation slugs are known, interleaving {@link PlannedGroupChild} folders at
|
|
635
|
+
* their declared positions. A group with `root: true` is an API tab's folder.
|
|
623
636
|
*
|
|
624
637
|
* @public
|
|
625
638
|
*/
|
|
626
639
|
interface PlannedApiGroup {
|
|
627
640
|
readonly dir: string;
|
|
628
641
|
readonly title: string;
|
|
642
|
+
readonly children: readonly PlannedGroupChild[];
|
|
643
|
+
/** Set on an API tab's own folder, so the sidebar scopes to the tab. */
|
|
644
|
+
readonly root?: boolean;
|
|
645
|
+
/** The tab's icon, on a `root` group. */
|
|
646
|
+
readonly icon?: string;
|
|
629
647
|
}
|
|
630
648
|
/**
|
|
631
649
|
* A `meta.json` file the plan wants written.
|
|
@@ -647,8 +665,14 @@ interface DocsTreePlan {
|
|
|
647
665
|
readonly specs: readonly string[];
|
|
648
666
|
readonly apiPages: readonly PlannedApiPage[];
|
|
649
667
|
readonly apiGroups: readonly PlannedApiGroup[];
|
|
650
|
-
/** Fully-known meta files: the root, tab folders, and doc groups. */
|
|
668
|
+
/** Fully-known meta files: the root, doc tab folders, and doc groups. */
|
|
651
669
|
readonly metas: readonly PlannedMeta[];
|
|
670
|
+
/**
|
|
671
|
+
* Doc pages declared inside API tabs. The plan cannot place them in the
|
|
672
|
+
* generated folders, so the generator reports them instead of dropping them
|
|
673
|
+
* silently; they stay reachable at their own URLs.
|
|
674
|
+
*/
|
|
675
|
+
readonly apiTabDocPages: readonly string[];
|
|
652
676
|
}
|
|
653
677
|
/**
|
|
654
678
|
* Options for {@link planDocsTree}.
|
|
@@ -656,23 +680,27 @@ interface DocsTreePlan {
|
|
|
656
680
|
* @public
|
|
657
681
|
*/
|
|
658
682
|
interface PlanDocsTreeOptions {
|
|
659
|
-
/** Folder for generated API pages. Default `api`. */
|
|
683
|
+
/** Folder for generated API pages when one tab publishes them. Default `api`. */
|
|
660
684
|
readonly apiDir?: string;
|
|
661
685
|
}
|
|
662
686
|
/**
|
|
663
687
|
* Plan the content tree for a navigation.
|
|
664
688
|
*
|
|
665
689
|
* Conventions (Mintlify-shaped):
|
|
666
|
-
* - A tab whose items reference OpenAPI files becomes
|
|
667
|
-
*
|
|
690
|
+
* - A tab whose items reference OpenAPI files becomes an API tab. With one API
|
|
691
|
+
* tab its folder is `apiDir`; with several, each tab's folder is its
|
|
692
|
+
* slugified title, so tabs never collide. Groups become nested folders named
|
|
693
|
+
* by slugified group title, to any depth.
|
|
668
694
|
* - A tab of doc pages becomes the folder its pages share (their first path
|
|
669
|
-
* segment); a doc group's pages must share one directory.
|
|
695
|
+
* segment); a doc group's pages must share one directory. Doc groups nest.
|
|
670
696
|
* - Root-level doc pages (no `/` in the path) are listed in the root meta.
|
|
671
697
|
* - Tab folders get `root: true`, so the sidebar scopes to the active tab.
|
|
698
|
+
* - Sidebar order is declaration order, pages and groups interleaved.
|
|
672
699
|
*
|
|
673
700
|
* @param navigation - the parsed navigation
|
|
674
701
|
* @param options - the API folder name
|
|
675
702
|
* @returns the plan the generator executes
|
|
703
|
+
* @throws when two sibling groups slugify to the same folder
|
|
676
704
|
* @public
|
|
677
705
|
*/
|
|
678
706
|
declare function planDocsTree(navigation: Navigation, options?: PlanDocsTreeOptions): DocsTreePlan;
|
|
@@ -1252,4 +1280,4 @@ declare class OpenApiMergeError extends Error {
|
|
|
1252
1280
|
*/
|
|
1253
1281
|
declare function mergeOpenApiDocuments(inputs: readonly unknown[], options: MergeOpenApiOptions): OpenApiDocument;
|
|
1254
1282
|
|
|
1255
|
-
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiGroup, type PlannedApiPage, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
|
1283
|
+
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiGroup, type PlannedApiPage, type PlannedGroupChild, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
package/dist/index.d.ts
CHANGED
|
@@ -617,15 +617,33 @@ interface PlannedApiPage {
|
|
|
617
617
|
/** Position within the group. */
|
|
618
618
|
readonly order: number;
|
|
619
619
|
}
|
|
620
|
+
/**
|
|
621
|
+
* A child folder of a planned API group, at its position among the group's
|
|
622
|
+
* pages. The generator merges these with the resolved page slugs to write the
|
|
623
|
+
* group's `meta.json` in declared order.
|
|
624
|
+
*
|
|
625
|
+
* @public
|
|
626
|
+
*/
|
|
627
|
+
interface PlannedGroupChild {
|
|
628
|
+
readonly order: number;
|
|
629
|
+
/** The child folder's name within the group directory. */
|
|
630
|
+
readonly folder: string;
|
|
631
|
+
}
|
|
620
632
|
/**
|
|
621
633
|
* A planned API group folder. The generator fills its page order once the
|
|
622
|
-
* operation slugs are known
|
|
634
|
+
* operation slugs are known, interleaving {@link PlannedGroupChild} folders at
|
|
635
|
+
* their declared positions. A group with `root: true` is an API tab's folder.
|
|
623
636
|
*
|
|
624
637
|
* @public
|
|
625
638
|
*/
|
|
626
639
|
interface PlannedApiGroup {
|
|
627
640
|
readonly dir: string;
|
|
628
641
|
readonly title: string;
|
|
642
|
+
readonly children: readonly PlannedGroupChild[];
|
|
643
|
+
/** Set on an API tab's own folder, so the sidebar scopes to the tab. */
|
|
644
|
+
readonly root?: boolean;
|
|
645
|
+
/** The tab's icon, on a `root` group. */
|
|
646
|
+
readonly icon?: string;
|
|
629
647
|
}
|
|
630
648
|
/**
|
|
631
649
|
* A `meta.json` file the plan wants written.
|
|
@@ -647,8 +665,14 @@ interface DocsTreePlan {
|
|
|
647
665
|
readonly specs: readonly string[];
|
|
648
666
|
readonly apiPages: readonly PlannedApiPage[];
|
|
649
667
|
readonly apiGroups: readonly PlannedApiGroup[];
|
|
650
|
-
/** Fully-known meta files: the root, tab folders, and doc groups. */
|
|
668
|
+
/** Fully-known meta files: the root, doc tab folders, and doc groups. */
|
|
651
669
|
readonly metas: readonly PlannedMeta[];
|
|
670
|
+
/**
|
|
671
|
+
* Doc pages declared inside API tabs. The plan cannot place them in the
|
|
672
|
+
* generated folders, so the generator reports them instead of dropping them
|
|
673
|
+
* silently; they stay reachable at their own URLs.
|
|
674
|
+
*/
|
|
675
|
+
readonly apiTabDocPages: readonly string[];
|
|
652
676
|
}
|
|
653
677
|
/**
|
|
654
678
|
* Options for {@link planDocsTree}.
|
|
@@ -656,23 +680,27 @@ interface DocsTreePlan {
|
|
|
656
680
|
* @public
|
|
657
681
|
*/
|
|
658
682
|
interface PlanDocsTreeOptions {
|
|
659
|
-
/** Folder for generated API pages. Default `api`. */
|
|
683
|
+
/** Folder for generated API pages when one tab publishes them. Default `api`. */
|
|
660
684
|
readonly apiDir?: string;
|
|
661
685
|
}
|
|
662
686
|
/**
|
|
663
687
|
* Plan the content tree for a navigation.
|
|
664
688
|
*
|
|
665
689
|
* Conventions (Mintlify-shaped):
|
|
666
|
-
* - A tab whose items reference OpenAPI files becomes
|
|
667
|
-
*
|
|
690
|
+
* - A tab whose items reference OpenAPI files becomes an API tab. With one API
|
|
691
|
+
* tab its folder is `apiDir`; with several, each tab's folder is its
|
|
692
|
+
* slugified title, so tabs never collide. Groups become nested folders named
|
|
693
|
+
* by slugified group title, to any depth.
|
|
668
694
|
* - A tab of doc pages becomes the folder its pages share (their first path
|
|
669
|
-
* segment); a doc group's pages must share one directory.
|
|
695
|
+
* segment); a doc group's pages must share one directory. Doc groups nest.
|
|
670
696
|
* - Root-level doc pages (no `/` in the path) are listed in the root meta.
|
|
671
697
|
* - Tab folders get `root: true`, so the sidebar scopes to the active tab.
|
|
698
|
+
* - Sidebar order is declaration order, pages and groups interleaved.
|
|
672
699
|
*
|
|
673
700
|
* @param navigation - the parsed navigation
|
|
674
701
|
* @param options - the API folder name
|
|
675
702
|
* @returns the plan the generator executes
|
|
703
|
+
* @throws when two sibling groups slugify to the same folder
|
|
676
704
|
* @public
|
|
677
705
|
*/
|
|
678
706
|
declare function planDocsTree(navigation: Navigation, options?: PlanDocsTreeOptions): DocsTreePlan;
|
|
@@ -1252,4 +1280,4 @@ declare class OpenApiMergeError extends Error {
|
|
|
1252
1280
|
*/
|
|
1253
1281
|
declare function mergeOpenApiDocuments(inputs: readonly unknown[], options: MergeOpenApiOptions): OpenApiDocument;
|
|
1254
1282
|
|
|
1255
|
-
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiGroup, type PlannedApiPage, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
|
1283
|
+
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiGroup, type PlannedApiPage, type PlannedGroupChild, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AI_PROVIDER_MODELS, AI_PROVIDER_NAMES, AiConfigError, DocsConfigError, InvalidNavigationError, OpenApiMergeError, ProxyTargetError, SESSION_COOKIE, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, defineDocsConfig, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, resolveAiConfig, searchIndex, signSession, unwrapProxyTarget, validateDocsConfig, verifySession } from './chunk-
|
|
1
|
+
export { AI_PROVIDER_MODELS, AI_PROVIDER_NAMES, AiConfigError, DocsConfigError, InvalidNavigationError, OpenApiMergeError, ProxyTargetError, SESSION_COOKIE, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, defineDocsConfig, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, resolveAiConfig, searchIndex, signSession, unwrapProxyTarget, validateDocsConfig, verifySession } from './chunk-JHN5XQPU.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaaiz/docs-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Neutral, self-hostable documentation framework core — navigation parsing, OpenAPI merging, MDX doc components, and a hardened try-it proxy. Config and content live in each consuming site.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|