@swell/cli
Version:
Swell's command line interface/utility
69 lines (68 loc) • 2.3 kB
TypeScript
/**
* Builds a list of stores while also highlighting the current store.
*
* @example <caption>Example output:</caption>
*
* > Stores you are logged in to:
* >
* > - Test Store, test
* > - Another Test, another-test (current)
*
* @param stores - The stores to build the display for
* @param currentStoreId - The ID of the default store
* @returns A list of stores ready to display.
*/
declare function showStores(stores: Store[], currentStoreId: string): string;
/**
* Select the store to login to from a CLI prompt.
*
* By default it will only show stores for which we don't already have a
* session id. If `force` is true, show all stores to pull the session id
* again.
*
* @param currentStoreId - The ID of the default store
* @param authorizations - The authorizations for the current user
* @param force - Whether to show all stores or not
*
* @returns The store ID to login to
*/
declare function selectStoreId({ authorizations, currentStoreId, force, }: {
authorizations: UserAuthorization[];
currentStoreId: string;
force: boolean;
}): Promise<any>;
/**
* Select the store to switch to from a CLI prompt from the list of
* already logged in stores.
*
* @param message Store selection message
* @returns The store ID to switch to
* @throws CLIError - If there are no stores to switch to
*/
declare function selectLoggedInStoreId(message?: string): Promise<string>;
/**
* Select an environment.
*
* @param message Environment selection message
* @returns Environment to switch to
* @throws CLIError - If there are no stores to switch to
*/
declare function selectEnvironmentId(message?: string): Promise<string>;
/**
* Ask the user if they want to make the given store id the default store.
*
* If there is no current store id, it will always be set as the default
* without asking.
*
* @param storeParams -
* currentStoreId - The ID of the default store
* storeId - The ID of the store to set as the default
* @param force - True to force
*
* @returns void
*/
declare function modifyDefaultStore({ currentStoreId, storeId, }: {
currentStoreId: string;
storeId: string;
}, force?: boolean): Promise<void>;
export { modifyDefaultStore, selectEnvironmentId, selectLoggedInStoreId, selectStoreId, showStores, };