UNPKG

@sap/cds-dk

Version:

Command line client and development toolkit for the SAP Cloud Application Programming Model

75 lines (48 loc) 2.22 kB
module.exports = Object.assign(extend, { options: ['--directory', '--subdomain', '--passcode', '--username', '--clientid', '--tagRule', '--defaultTag'], flags: ['--download-migrated-projects'], shortcuts: ['-d', '-s', '-p', '-u', '-c'], help: ` # SYNOPSIS *cds extend* --download-migrated-projects <app-url> Download extension project after migration to @sap/cds-mtxs. # OPTIONS *-d* | *--directory* <project-extension-directory> Specify the target directory of your extension project. By default, the current working directory is used. *-s* | *--subdomain* <tenant-subdomain> Specify your tenant's subdomain. By default, it's determined from the app URL. *-p* | *--passcode* <passcode> Tenant-specific passcode for authentication. *-u* | *--username* <name> Deprecated. Use passcode parameter instead. *-c* | *--clientid* <clientid> Client ID for authentication. This will override the default Client ID from environment. *--tagRule* Rule used to split up migrated extension projects into separate projects (please check migration documentation for more). *--defaultTag* Default tag used for migrated extension projects, default is 'migrated' (please check migration documentation for more). # SEE ALSO *cds pull* to get the CDS model of a SaaS app based on current MTX Services (@sap/cds-mtxs). https://cap.cloud.sap/docs/guides/multitenancy/mtxs for information on @sap/cds-mtxs. https://cap.cloud.sap/docs/guides/multitenancy/old-mtx-migration for information on migrating from the old MTX Services to @sap/cds-mtxs. `}) async function extend ([url], options = {}) { if (!options['download-migrated-projects']) { console.log('Please provide the --download-migrated-projects flag to enable this command.'); return; } delete options['download-migrated-projects']; const [username, password] = options.username?.split(':') ?? []; delete options.user; await require('../lib/mtx/download_legacy').run({ ...options, url, username, password }); } /* eslint no-console: off */