UNPKG

@salesforce/source-tracking

Version:

API for tracking local and remote Salesforce metadata changes

36 lines 2.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDefined = exports.isChangeResultWithNameAndType = exports.FileResponseHasPath = exports.FileResponseIsNotDeleted = exports.FileResponseIsDeleted = exports.isSdrSuccess = exports.isSdrFailure = exports.metadataMemberGuard = void 0; /* * Copyright 2025, Salesforce, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve"); const metadataMemberGuard = (input) => input !== undefined && typeof input.fullName === 'string' && typeof input.type === 'string'; exports.metadataMemberGuard = metadataMemberGuard; const isSdrFailure = (fileResponse) => fileResponse.state === source_deploy_retrieve_1.ComponentStatus.Failed; exports.isSdrFailure = isSdrFailure; const isSdrSuccess = (fileResponse) => fileResponse.state !== source_deploy_retrieve_1.ComponentStatus.Failed; exports.isSdrSuccess = isSdrSuccess; const FileResponseIsDeleted = (fileResponse) => fileResponse.state === source_deploy_retrieve_1.ComponentStatus.Deleted; exports.FileResponseIsDeleted = FileResponseIsDeleted; const FileResponseIsNotDeleted = (fileResponse) => fileResponse.state !== source_deploy_retrieve_1.ComponentStatus.Deleted; exports.FileResponseIsNotDeleted = FileResponseIsNotDeleted; const FileResponseHasPath = (fileResponse) => fileResponse.filePath !== undefined; exports.FileResponseHasPath = FileResponseHasPath; const isChangeResultWithNameAndType = (cr) => typeof cr === 'object' && typeof cr.name === 'string' && typeof cr.type === 'string'; exports.isChangeResultWithNameAndType = isChangeResultWithNameAndType; const isDefined = (x) => x !== undefined; exports.isDefined = isDefined; //# sourceMappingURL=guards.js.map