@curvenote/cli
Version:
CLI Client library for Curvenote
41 lines • 2.02 kB
TypeScript
import type { ProjectConfig, SiteConfig, SiteProject } from 'myst-config';
import { Project } from '../models.js';
import type { ISession } from '../session/types.js';
import type { SyncCiHelperOptions } from './types.js';
export declare function projectLogString(project: Project): string;
export declare const INIT_LOGO_PATH: string;
export declare function getDefaultSiteConfig(title?: string): SiteConfig;
export declare function getDefaultSiteConfigFromRemote(session: ISession, projectId: string, siteProject: SiteProject): Promise<SiteConfig>;
export declare function getDefaultProjectConfig(title?: string): Promise<ProjectConfig>;
export declare function projectIdFromLink(session: ISession, link: string): string;
export declare function validateLinkIsAProject(session: ISession, projectLink: string): Promise<Project | undefined>;
export declare function processOption(opts: SyncCiHelperOptions | undefined): {
yes: boolean | undefined;
debug?: boolean;
ci?: boolean;
} | undefined;
/**
* Normalize GitHub URL to HTTPS clone URL
* Handles formats:
* - https://github.com/user/repo
* - https://github.com/user/repo.git
* - git@github.com:user/repo.git
* - github.com/user/repo
* - user/repo
*/
export declare function normalizeGithubUrl(url: string): string;
/**
* Generate a new work key (UUID) and validate it against the API to ensure it's available.
* Retries up to 3 times if the key is already taken.
*
* @param session - The session object for API calls
* @returns A validated work key that is available
* @throws Error if all retry attempts fail, including Node.js version, Curvenote version, and support contact info
*/
export declare function generateNewValidatedWorkKey(session: ISession): Promise<string>;
/**
* Prepare project config for writing by removing computed/internal fields
* This makes the YAML more compact and readable
*/
export declare function cleanProjectConfigForWrite(projectConfig: ProjectConfig): ProjectConfig;
//# sourceMappingURL=utils.d.ts.map