@puls-atlas/cli
Version:
The Puls Atlas CLI tool for managing Atlas projects
18 lines • 2.6 kB
JavaScript
import handlers, { warnDeprecatedExportCommand } from './index.js';
import hooks from '../../hooks/index.js';
const withDeprecatedExportWarning = command => command.hook('preAction', () => warnDeprecatedExportCommand());
const registerExportCommands = (program, {
withEnvironmentOptions
}) => {
const exportCmd = withDeprecatedExportWarning(program.command('export').description('Deprecated legacy Atlas export commands. Prefer atlas sync.').option('-y, --all-yes', 'Say yes to all confirm prompts.'));
withDeprecatedExportWarning(withEnvironmentOptions(exportCmd.command('deploy').description('Deploy Atlas export runtime components.'))).action(handlers.deploy).hook('preAction', hooks.versionCheck);
withDeprecatedExportWarning(withEnvironmentOptions(exportCmd.command('destroy').description('Destroy Atlas export runtime components.'))).action(handlers.destroy).hook('preAction', hooks.versionCheck);
withDeprecatedExportWarning(withEnvironmentOptions(exportCmd.command('logs').description('Show Atlas export logs for the selected project.'))).action(handlers.logs).hook('preAction', hooks.versionCheck);
withDeprecatedExportWarning(withEnvironmentOptions(exportCmd.command('provision').description('Provision Atlas export infrastructure.'))).action(handlers.provision).hook('preAction', hooks.versionCheck);
withDeprecatedExportWarning(withEnvironmentOptions(exportCmd.command('status').description('Show Atlas export status for the selected project.'))).action(handlers.status).hook('preAction', hooks.versionCheck);
withDeprecatedExportWarning(withEnvironmentOptions(exportCmd.command('verify').description('Verify Atlas export in the selected project.'))).action(handlers.verify).hook('preAction', hooks.versionCheck);
withDeprecatedExportWarning(exportCmd.command('firestore').usage('atlas export firestore').usage('atlas export firestore --destination=GCS').description('Set up exports from Firestore to another service.').option('--destination <service>', 'Choose a destination for the exported data', 'BigQuery').option('--mode <mode>', 'The managing mode should be one of `init, insert, migrate, reset`').option('--collection <collection>', 'Provide a collection to manage or export.').action(handlers.firestore));
withDeprecatedExportWarning(exportCmd.command('init').usage('atlas export init').description('Set up the necessary firebase functions to use the export tooling.').option('--copy-local <path>', 'A file path to a local version of the atlas-export function folder').action(handlers.initialize));
return exportCmd;
};
export default registerExportCommands;