UNPKG

@curvenote/cli

Version:
53 lines 2.25 kB
import type { WorkDTO } from '@curvenote/common'; import type { ISession } from '../session/types.js'; import type { BaseOpts } from '../logs/types.js'; export declare const CDN_KEY_RE: RegExp; export declare const DEV_CDN_KEY = "ad7fa60f-5460-4bf9-96ea-59be87944e41"; export declare function performCleanRebuild(session: ISession, opts?: BaseOpts): Promise<void>; export declare function uploadAndGetCdnKey(session: ISession, cdn: string, opts?: { resume?: boolean; }): Promise<string>; /** * Get project.id from the current config file * * The project.id will be used as journals work key * * If no config file is found this exits * If config file exists but project.id is not defined, * this returns undefined. */ export declare function workKeyFromConfig(session: ISession): string | undefined; export declare function workDoiFromConfig(session: ISession): string | undefined; /** * Load work from transfer.yml data * * Returns undefined if work for the given venue is not defined or * if the API request for the work fails. */ export declare function getMyWorkFromKey(session: ISession, key: string): Promise<WorkDTO | undefined>; export declare function getMyWorksFromDoi(session: ISession, doi: string): Promise<WorkDTO[]>; export declare function workKeyExists(session: ISession, key: string): Promise<boolean>; export declare function checkMyWorkAccess(session: ISession, key: string): Promise<{ owned: WorkDTO | undefined; taken: boolean; }>; /** * Prompt user for a new work key * * First, gives a simple Y/n with a default UUID. If the user is unhappy with that, * they are prompted to write their own key. * * This key cannot already exist as a work key; if you want to link to an existing * work, you must put the key directly in your project config file. */ export declare function promptForNewKey(session: ISession, opts?: { yes?: boolean; }): Promise<string>; /** * Updates project.id in config yaml with key * * Creates a backup of the original file in the _build/temp folder */ export declare function writeKeyToConfig(session: ISession, key: string): Promise<void>; export declare function exitOnInvalidKeyOption(session: ISession, key: string): void; //# sourceMappingURL=utils.d.ts.map