salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
40 lines (38 loc) • 1.24 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
*/
const orgSnapshotApi_1 = require("./orgSnapshotApi");
const logger = require("../../core/logApi");
/**
* List Org Snapshots linked DevHub.
*/
class OrgSnapshotListCommand {
constructor() {
this.logger = logger.child('org:snapshot:list');
this.records = [];
}
execute(context) {
return orgSnapshotApi_1.OrgSnapshotApiImpl.create(context.org)
.then((orgSnapshotApi) => orgSnapshotApi.list())
.then((records) => {
this.records = records;
return records;
});
}
/**
* returns a human readable message for a cli output
*
* @param result - the data representing the Org Snapshot
* @returns {string}
*/
getColumnData() {
this.logger.styledHeader(this.logger.color.blue(`Org Snapshots [${this.records.length}]`));
return orgSnapshotApi_1.ORG_SNAPSHOT_COLUMNS;
}
}
module.exports = OrgSnapshotListCommand;
//# sourceMappingURL=orgSnapshotListCommand.js.map