UNPKG

@salesforce/plugin-packaging

Version:

SF plugin that support Salesforce Packaging Platform

51 lines 2.37 kB
/* * Copyright 2026, 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. */ import { Flags, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core/messages'; import { SubscriberPackageVersion } from '@salesforce/packaging'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_uninstall_report'); export class PackageUninstallReportCommand extends SfCommand { static summary = messages.getMessage('summary'); static examples = messages.getMessages('examples'); static deprecateAliases = true; static aliases = ['force:package:uninstall:report']; static flags = { loglevel, 'target-org': requiredOrgFlagWithDeprecations, 'api-version': orgApiVersionFlagWithDeprecations, // eslint-disable-next-line sf-plugin/id-flag-suggestions 'request-id': Flags.salesforceId({ length: 'both', deprecateAliases: true, aliases: ['requestid'], char: 'i', summary: messages.getMessage('flags.request-id.summary'), required: true, startsWith: '06y', }), }; async run() { const { flags } = await this.parse(PackageUninstallReportCommand); const result = await SubscriberPackageVersion.uninstallStatus(flags['request-id'], flags['target-org'].getConnection(flags['api-version'])); const arg = result.Status === 'Success' ? [result.SubscriberPackageVersionId] : [this.config.bin, result.Id, flags['target-org'].getUsername()]; this.log(messages.getMessage(result.Status, arg)); return result; } } //# sourceMappingURL=report.js.map