UNPKG

@salesforce/plugin-org

Version:

Commands to interact with Salesforce orgs

64 lines 1.96 kB
/* * Copyright (c) 2025, 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 */ 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