salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
39 lines (37 loc) • 1.74 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.BotMetadataType = void 0;
const path = require("path");
const sourcePathUtil_1 = require("../sourcePathUtil");
const defaultMetadataType_1 = require("./defaultMetadataType");
class BotMetadataType extends defaultMetadataType_1.DefaultMetadataType {
hasIndividuallyAddressableChildWorkspaceElements() {
return true;
}
getAggregateMetadataFilePathFromWorkspacePath(filePath) {
super.debug(() => `getAggregateMetadataFilePathFromWorkspacePath filePath: ${filePath}`);
return sourcePathUtil_1.removeParentDirFromPath(filePath);
}
entityExistsInWorkspace(metadataFilePath) {
const aggregateFullName = this.getAggregateFullNameFromFilePath(metadataFilePath);
super.debug(() => `entityExistsInWorkspace metadataFilePath: ${metadataFilePath}`);
return sourcePathUtil_1.canRead(path.join(path.dirname(metadataFilePath), aggregateFullName));
}
isContainerValid(container) {
const containerDataNodes = container.data.childNodes;
const isValid = !(containerDataNodes &&
containerDataNodes[0].tagName === 'xml' &&
containerDataNodes[1].tagName == this.getMetadataName() &&
containerDataNodes[1].childNodes.length === 0);
super.debug(() => `isContainerValid isValid: ${isValid}`);
return isValid;
}
}
exports.BotMetadataType = BotMetadataType;
//# sourceMappingURL=botMetadataType.js.map