@mintlify/previewing 3.0.3 → 3.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.
@@ -0,0 +1,9 @@
1
+ export declare const TARGET_MINT_VERSION = "v0.0.9";
2
+ export declare const INSTALL_PATH: string;
3
+ export declare const HOME_DIR: string;
4
+ export declare const DOT_MINTLIFY: string;
5
+ export declare const VERSION_PATH: string;
6
+ export declare const CLIENT_PATH: string;
7
+ export declare const MINT_PATH: string;
8
+ export declare const CMD_EXEC_PATH: string;
9
+ export declare const SUPPORTED_MEDIA_EXTENSIONS: string[];
@@ -0,0 +1,4 @@
1
+ export declare function isValidImageSrc(src: string): boolean;
2
+ export declare function removeMetadataFromImageSrc(src: string): string;
3
+ export declare function cleanImageSrc(src: string, origin: string): string;
4
+ export default function downloadImage(imageSrc: string, writePath: string, overwrite?: boolean): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import dev from "./local-preview/index.js";
2
+ import installDepsCommand from "./local-preview/helper-commands/installDepsCommand.js";
3
+ export { dev, installDepsCommand };
@@ -0,0 +1,2 @@
1
+ declare const installDeps: () => Promise<void>;
2
+ export default installDeps;
@@ -0,0 +1,3 @@
1
+ import { ArgumentsCamelCase } from "yargs";
2
+ declare const dev: (argv: ArgumentsCamelCase) => Promise<void>;
3
+ export default dev;
@@ -0,0 +1,8 @@
1
+ import { PotentialFileCategory } from "./utils/types.js";
2
+ export declare const categorizeFiles: (contentDirectoryPath: string) => Promise<{
3
+ contentFilenames: string[];
4
+ staticFilenames: string[];
5
+ openApiFiles: OpenApiFile[];
6
+ snippets: string[];
7
+ }>;
8
+ export declare const getCategory: (filePath: string) => PotentialFileCategory;
@@ -0,0 +1,12 @@
1
+ type DecoratedMintNavigation = DecoratedMintNavigationEntry[];
2
+ type DecoratedMintNavigationEntry = {
3
+ group: string;
4
+ version?: string;
5
+ pages: DecoratedMintNavigationEntryChild[];
6
+ };
7
+ type DecoratedMintNavigationEntryChild = DecoratedMintNavigationEntry | PageMetadata;
8
+ type PageMetadata = Record<PageMetadataKeys, string>;
9
+ declare const pageMetadataKeys: readonly ["title", "description", "sidebarTitle", "href", "api", "openapi", "contentType", "auth", "version", "mode", "hideFooterPagination", "authors", "lastUpdatedDate", "createdDate", "size"];
10
+ type PageMetadataKeys = typeof pageMetadataKeys[number];
11
+ export declare const generateNav: () => Promise<DecoratedMintNavigation>;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const listener: () => void;
2
+ export default listener;
@@ -0,0 +1,2 @@
1
+ export declare const updateGeneratedNav: () => Promise<void>;
2
+ export declare const updateOpenApiFiles: () => Promise<void>;
@@ -0,0 +1,11 @@
1
+ declare const createPage: (pagePath: string, pageContent: string, contentDirectoryPath: string, openApiFiles: OpenApiFile[]) => Promise<{
2
+ pageMetadata: {
3
+ href: string;
4
+ title: string;
5
+ description: string;
6
+ };
7
+ pageContent: string;
8
+ slug: string;
9
+ }>;
10
+ export declare const slugToTitle: (slug: string) => string;
11
+ export default createPage;
@@ -0,0 +1,21 @@
1
+ export declare const extractMethodAndEndpoint: (api: string) => {
2
+ method?: string;
3
+ endpoint: string;
4
+ filename?: string;
5
+ };
6
+ export declare const getOpenApiOperationMethodAndEndpoint: (openApi: any, openApiMetaField: string) => {
7
+ operation?: undefined;
8
+ method?: undefined;
9
+ endpoint?: undefined;
10
+ } | {
11
+ operation: any;
12
+ method: string;
13
+ endpoint: string;
14
+ };
15
+ export declare const getOpenApiTitleAndDescription: (openApi: any, openApiMetaField: any) => {
16
+ title?: undefined;
17
+ description?: undefined;
18
+ } | {
19
+ title: any;
20
+ description: any;
21
+ };
@@ -0,0 +1,2 @@
1
+ export declare const getConfigPath: (contentDirectoryPath: string) => Promise<string | null>;
2
+ export declare const getConfigObj: (contentDirectoryPath: string) => Promise<any>;
@@ -0,0 +1 @@
1
+ export declare function toTitleCase(text: string): string;
@@ -0,0 +1,2 @@
1
+ export type PotentialFileCategory = "page" | "snippet" | "mintConfig" | "potentialYamlOpenApiSpec" | "potentialJsonOpenApiSpec" | "staticFile";
2
+ export type FileCategory = "page" | "snippet" | "mintConfig" | "openApi" | "staticFile";
@@ -0,0 +1,14 @@
1
+ export declare const getFileExtension: (filename: string) => string;
2
+ export type OpenApiCheckResult = {
3
+ spec: any;
4
+ isOpenApi: boolean;
5
+ };
6
+ export declare const openApiCheck: (path: string) => Promise<OpenApiCheckResult>;
7
+ export declare const filterOutNullInGroup: (group: MintNavigation) => {
8
+ pages: MintNavigationEntry[];
9
+ group: string;
10
+ version?: string;
11
+ };
12
+ export declare const getFileList: (dirName: string, og?: string) => Promise<string[]>;
13
+ export declare const isFileSizeValid: (path: string, maxFileSizeInMb: number) => Promise<boolean>;
14
+ export declare function isError(obj: unknown): boolean;
package/dist/util.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import { Ora as OraType } from "ora";
2
+ export declare const MintConfig: (name: string, color: string, ctaName: string, ctaUrl: string, filename: string) => {
3
+ name: string;
4
+ logo: string;
5
+ favicon: string;
6
+ colors: {
7
+ primary: string;
8
+ };
9
+ topbarLinks: any[];
10
+ topbarCtaButton: {
11
+ name: string;
12
+ url: string;
13
+ };
14
+ anchors: any[];
15
+ navigation: {
16
+ group: string;
17
+ pages: string[];
18
+ }[];
19
+ };
20
+ export declare const Page: (title: string, description?: string, markdown?: string) => string;
21
+ export declare function getOrigin(url: string): string;
22
+ export declare function objToReadableString(objs: MintNavigationEntry[]): string;
23
+ export declare const toFilename: (title: string) => string;
24
+ export declare const addMdx: (fileName: string) => string;
25
+ export declare const buildLogger: (startText?: string) => OraType;
26
+ export declare const getFileExtension: (filename: string) => string;
27
+ export declare const fileBelongsInPagesFolder: (filename: string) => boolean;
28
+ export declare const ensureYarn: (logger: OraType) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/previewing",
3
- "version": "3.0.3",
3
+ "version": "3.1.0",
4
4
  "description": "Preview Mintlify docs locally",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"