UNPKG

@amplitude/ampli

Version:

Amplitude CLI

32 lines (31 loc) 2.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const command_1 = require("@oclif/command"); const base_1 = require("../base"); const pull_1 = require("../actions/pull"); const configure_1 = require("../actions/configure"); class Pull extends base_1.default { async run() { const { flags: pullCommandFlags, args: { source } } = this.parse(Pull); const { 'omit-api-keys': omitApiKeys, 'include-api-keys': includeApiKeys } = pullCommandFlags, pullFlags = tslib_1.__rest(pullCommandFlags, ['omit-api-keys', 'include-api-keys']); await this.mustBeInitialized(pullFlags, true); await new pull_1.default(Object.assign({ omitApiKeys: omitApiKeys || (includeApiKeys ? false : undefined) }, pullFlags), { source }, this.actionConfig(Pull.id), this.setBranchMappedToMain.bind(this)).run(); } } exports.default = Pull; Pull.id = 'pull'; Pull.description = 'pull down the latest tracking plan and generate a tracking library'; Pull.flags = Object.assign({ branch: command_1.flags.string({ char: 'b', description: 'the branch to pull' }), version: command_1.flags.string({ char: 'v', description: 'the version to pull' }), path: command_1.flags.string({ char: 'p', description: 'where the tracking library will be created' }), 'omit-api-keys': command_1.flags.boolean({ description: 'omit api keys from the tracking library' }), 'include-api-keys': command_1.flags.boolean({ description: 'include api keys to the tracking library' }), [configure_1.DEPRECATED_RUNTIMES]: command_1.flags.boolean({ description: 'show deprecated SDK options for source configuration (for Itly users).' }) }, base_1.default.commonFlagsWithToken); Pull.args = [ { name: 'source', required: false }, ]; Pull.usage = 'pull [<source>] [-p <path>] [-b <branch>]'; Pull.examples = [ '$ ampli pull web', '$ ampli pull web -p ./ampli -b develop', '$ ampli pull web -p ./ampli -b develop -v 2.1.1', '$ ampli pull --omit-api-keys web', '$ ampli pull --include-api-keys web', `$ ampli pull --${configure_1.DEPRECATED_RUNTIMES}`, ];