UNPKG

salesforce-alm

Version:

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

48 lines (46 loc) 2.16 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.CustomObjectSubtypeMetadataType = void 0; const path = require("path"); const defaultMetadataType_1 = require("./defaultMetadataType"); const PathUtil = require("../sourcePathUtil"); const MetadataRegistry = require("../metadataRegistry"); class CustomObjectSubtypeMetadataType extends defaultMetadataType_1.DefaultMetadataType { getAggregateMetadataName() { return this.typeDefObj.parent.metadataName; } getFullNameFromFilePath(filePath) { const parentName = PathUtil.getGrandparentDirectoryName(filePath); const fileName = PathUtil.getFileName(filePath); return `${parentName}.${fileName}`; } getAggregateFullNameFromFilePath(filePath) { return PathUtil.getGrandparentDirectoryName(filePath); } getAggregateMetadataFilePathFromWorkspacePath(filePath) { const aggregateFullName = this.getAggregateFullNameFromFilePath(filePath); const pathToDefaultDir = PathUtil.getPathToDir(filePath, this.typeDefObj.parent.defaultDirectory); const fileName = `${aggregateFullName}.${this.typeDefObj.parent.ext}${MetadataRegistry.getMetadataFileExt()}`; return path.join(pathToDefaultDir, fileName); } getAggregateFullNameFromSourceMemberName(sourceMemberName) { return sourceMemberName.split('.')[0]; } getAggregateFullNameFromWorkspaceFullName(workspaceFullName) { return workspaceFullName.split('.')[0]; } getAggregateFullNameFromComponentFailure(componentFailure) { return this.getAggregateFullNameFromWorkspaceFullName(componentFailure.fullName); } getWorkspaceFullNameFromComponentFailure(componentFailure) { return componentFailure.fullName; } } exports.CustomObjectSubtypeMetadataType = CustomObjectSubtypeMetadataType; //# sourceMappingURL=customObjectSubtypeMetadataType.js.map