@salesforce/plugin-org
Version:
Commands to interact with Salesforce orgs
73 lines • 2.33 kB
JavaScript
/*
* 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 { MultiStageOutput } from '@oclif/multi-stage-output';
export class SandboxStages {
mso;
refresh;
constructor({ title, jsonEnabled, refresh = false }) {
this.refresh = refresh;
this.mso = new MultiStageOutput({
stages: ['Creating new sandbox', 'Refreshing org', 'Authenticating'],
title,
jsonEnabled,
stageSpecificBlock: [
{
get: (data) => data?.SandboxName,
stage: 'Creating new sandbox',
label: 'Name',
type: 'dynamic-key-value',
},
{
get: (data) => data?.Id,
stage: 'Creating new sandbox',
label: 'ID',
type: 'dynamic-key-value',
},
],
postStagesBlock: [
{
label: 'Status',
get: (data) => data?.Status,
type: 'dynamic-key-value',
bold: true,
},
{
label: 'Copy progress',
get: (data) => `${data?.CopyProgress ?? 0}%`,
type: 'dynamic-key-value',
},
],
});
}
start() {
if (this.refresh) {
this.mso.skipTo('Refreshing org');
}
else {
this.mso.goto('Creating new sandbox');
}
}
auth() {
this.mso.goto('Authenticating');
}
update(data) {
this.mso.updateData(data);
}
stop(finalStatus) {
this.mso.stop(finalStatus);
}
}
//# sourceMappingURL=sandboxStages.js.map