UNPKG

salesforce-alm

Version:

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

46 lines (44 loc) 2.2 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.SharingRulesMetadataType = void 0; const nondecomposedTypesWithChildrenMetadataType_1 = require("./nondecomposedTypesWithChildrenMetadataType"); class SharingRulesMetadataType extends nondecomposedTypesWithChildrenMetadataType_1.NondecomposedTypesWithChildrenMetadataType { /** * Sharing rules are tracked at the fine-grained level on the server, but they are nondecomposed in the workspace * If a child of a sharing rule type has been changed on the server, this corresponds to the aggregate file in the workspace * * @param {string} sourceMemberFullName * @param {string} workspaceFullName * @returns {boolean} */ sourceMemberFullNameCorrespondsWithWorkspaceFullName(sourceMemberFullName, workspaceFullName) { return sourceMemberFullName.split('.')[0] === workspaceFullName; } // eslint-disable-next-line @typescript-eslint/no-unused-vars getDisplayNameForRemoteChange(sourceMemberType) { return this.typeDefObj.metadataName; } parseSourceMemberForMetadataRetrieve(sourceMemberName, sourceMemberType, isNameObsolete) { if (sourceMemberType === 'SharingOwnerRule' || sourceMemberType === 'SharingCriteriaRule' || sourceMemberType === 'SharingGuestRule' || sourceMemberType === 'SharingTerritoryRule') { const fullName = this.getAggregateFullNameFromSourceMemberName(sourceMemberName); // these types are not decomposed, so deletions of child types are part of changes to the larger parent container return { fullName: `${fullName}.*`, type: sourceMemberType }; } return { fullName: sourceMemberName, type: sourceMemberType, isNameObsolete, }; } } exports.SharingRulesMetadataType = SharingRulesMetadataType; //# sourceMappingURL=sharingRulesMetadataType.js.map