salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
52 lines (50 loc) • 2.19 kB
JavaScript
;
/*
* Copyright (c) 2020, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrgShapeListCommand = void 0;
// This is the legacy converted command file. Ignoring code-coverage since this is generated.
// THIS SHOULD BE REMOVED WHEN CONVERTED TO EXTEND SfdxCommand
/* istanbul ignore file */
const os_1 = require("os");
const command_1 = require("@salesforce/command");
const core_1 = require("@salesforce/core");
const chalk_1 = require("chalk");
const orgShapeListCommand_1 = require("../../../../lib/org/orgShapeListCommand");
core_1.Messages.importMessagesDirectory(__dirname);
const messages = core_1.Messages.loadMessages('salesforce-alm', 'org_shape_list');
// default columns for the shape list
const orgShapeColumns = [
{ key: 'defaultMarker', label: '' },
{ key: 'alias', label: 'ALIAS' },
{ key: 'username', label: 'USERNAME' },
{ key: 'orgId', label: 'ORG ID' },
{ key: 'status', label: 'SHAPE STATUS' },
{ key: 'createdBy', label: 'CREATED BY' },
{ key: 'createdDate', label: 'CREATED DATE' },
];
class OrgShapeListCommand extends command_1.SfdxCommand {
async run() {
const shapes = await orgShapeListCommand_1.getAllOrgShapesFromAuthenticatedOrgs();
if (shapes.length === 0) {
this.ux.log(messages.getMessage('noOrgShapes'));
return shapes;
}
this.ux.styledHeader('Org Shapes');
this.ux.table(shapes.map((shape) => (shape.status === 'Active' ? { ...shape, status: chalk_1.default.green(shape.status) } : shape)), { columns: orgShapeColumns });
return shapes;
}
}
exports.OrgShapeListCommand = OrgShapeListCommand;
OrgShapeListCommand.description = messages.getMessage('description');
OrgShapeListCommand.examples = messages.getMessage('help').split(os_1.EOL);
OrgShapeListCommand.flagsConfig = {
verbose: command_1.flags.builtin({
description: messages.getMessage('verbose'),
}),
};
//# sourceMappingURL=list.js.map