UNPKG

salesforce-alm

Version:

This package contains tools, and APIs, for an improved salesforce.com developer experience.

90 lines (88 loc) 2.54 kB
"use strict"; /* * 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.WorkspaceElement = void 0; /** * This class represents the info for a sourcePath in the workspace */ class WorkspaceElement { constructor(metadataName, fullName, sourcePath, state, deleteSupported) { this.metadataName = metadataName; this.fullName = fullName; this.sourcePath = sourcePath; this.state = state; this.deleteSupported = deleteSupported; } /** * Gets the name for the metadata type of the workspace element - in the case of decomposition, this would be the type for the * decomposed element (ex. CustomField) * * @returns {string} */ getMetadataName() { return this.metadataName; } /** * Gets the fullName for the workspace element - in the case of decomposition, this would be the fullName of the * decomposed element (ex. for CustomField this would be 'CustomObjectName__c.CustomFieldName__c' * * @returns {string} */ getFullName() { return this.fullName; } /** * Gets the source state of the workspace element * * @returns {string} */ getState() { return this.state; } /** * Set the source state of the workspace element * * @param state */ setState(state) { this.state = state; } /** * Gets the full path to the element in the workspace * * @returns {string} */ getSourcePath() { return this.sourcePath; } /** * Returns true if the workspace element can be deleted from the scratch org * * @returns {boolean} */ getDeleteSupported() { return this.deleteSupported; } /** * Convenience method to return a plain old javascript object (aka POJO) of the * properties. Used by commands for table output. * * @returns {WorkspaceElementObj} */ toObject() { return { state: this.state, fullName: this.fullName, type: this.metadataName, filePath: this.sourcePath, deleteSupported: this.deleteSupported, }; } } exports.WorkspaceElement = WorkspaceElement; //# sourceMappingURL=workspaceElement.js.map