UNPKG

salesforce-alm

Version:

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

46 lines (44 loc) 2.24 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.CustomObjectTranslationSubtypeMetadataType = void 0; const path = require("path"); const defaultMetadataType_1 = require("./defaultMetadataType"); const PathUtil = require("../sourcePathUtil"); const MetadataRegistry = require("../metadataRegistry"); class CustomObjectTranslationSubtypeMetadataType extends defaultMetadataType_1.DefaultMetadataType { getAggregateMetadataName() { return this.typeDefObj.parent.metadataName; } getFullNameFromFilePath(filePath) { const parentName = PathUtil.getParentDirectoryName(filePath); const fileName = PathUtil.getFileName(filePath); return `${parentName}.${fileName}`; } getAggregateFullNameFromFilePath(filePath) { return PathUtil.getParentDirectoryName(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); } getAggregateFullNameFromWorkspaceFullName(workspaceFullName) { return workspaceFullName.split('.')[0]; } sourceMemberFullNameCorrespondsWithWorkspaceFullName(sourceMemberFullName, workspaceFullName) { const aggregateFullName = this.getAggregateFullNameFromWorkspaceFullName(workspaceFullName); return sourceMemberFullName === aggregateFullName; } getAggregateFullNameFromComponentFailure(componentFailure) { return this.getAggregateFullNameFromWorkspaceFullName(componentFailure.fullName); } } exports.CustomObjectTranslationSubtypeMetadataType = CustomObjectTranslationSubtypeMetadataType; //# sourceMappingURL=customObjectTranslationSubtypeMetadataType.js.map