@openinc/parse-server-opendash
Version:
Parse Server Cloud Code for open.INC Stack.
40 lines (39 loc) • 1.55 kB
TypeScript
import { FileConfig, FolderConfig, ImportOptions } from "../types";
export declare const FOLDER_CONFIG_ALLOWED_KEYS: readonly ["title", "order", "icon", "files", "feature"];
export type FolderConfigAllowedKey = (typeof FOLDER_CONFIG_ALLOWED_KEYS)[number];
export declare const FILE_CONFIG_ALLOWED_KEYS: readonly ["order", "icon", "title", "locationPattern", "locations", "feature"];
export type FileConfigAllowedKey = (typeof FILE_CONFIG_ALLOWED_KEYS)[number];
/**
* Default configuration for documentation import
*/
export declare const DEFAULT_IMPORT_CONFIG: Partial<ImportOptions>;
export declare const DEFAULT_FILE_CONFIG: Required<Pick<FileConfig, "order" | "icon">>;
/**
* Preset configurations for different use cases
*/
export declare const IMPORT_PRESETS: {
DOCS_AND_CONFIG: {
includeExtensions: string[];
defaultFolderConfig: {
order: number;
icon: string;
};
};
MEDIA_ONLY: {
includeExtensions: string[];
defaultFolderConfig: {
template: string;
tags: string[];
};
};
};
/**
* Helper function to merge configuration
*/
export declare function createImportConfig(overrides?: Partial<ImportOptions>, preset?: keyof typeof IMPORT_PRESETS): ImportOptions;
/**
* Sanitize a raw (parsed) folder config object by picking only allowed keys
* and recursively sanitizing file configs.
*/
export declare function sanitizeFolderConfig(raw: any): FolderConfig;
export declare function sanitizeFileConfig(raw: any): FileConfig;