@curvenote/cli
Version:
CLI Client library for Curvenote
29 lines • 1.28 kB
TypeScript
import type { CollectionListingDTO, SubmissionKindDTO, SubmissionKindListingDTO } from '@curvenote/common';
import type { ISession } from '../session/types.js';
/**
* Fetch `venue` kinds from API
*/
export declare function listSubmissionKinds(session: ISession, venue: string): Promise<SubmissionKindListingDTO>;
/**
* Choose and return one kind based only on venue
*
* Successful cases include:
* - `venue` with a single `kind`, which is returned
* - `opts.yes` is `true` and the `venue` has a default `kind`, which is returned
* - user interactively selects one of the available `kinds` on the `venue`
*
* On failure, this function will `process.exit(1)`. Failure cases include:
* - Fetch for venue kinds fails (user is not authorized, venue does not exist, etc)
* - Venue has no kinds
* - `opts.yes` is `true` but there is no default `kind`
*
* This function also takes `collections`. These have no effect on the `kind` determination,
* but they can improve messaging during interactive selection.
*/
export declare function determineKindFromVenue(session: ISession, venue: string, collections?: CollectionListingDTO, opts?: {
yes?: boolean;
}): Promise<{
kind: SubmissionKindDTO;
prompted?: boolean;
}>;
//# sourceMappingURL=kind.utils.d.ts.map