How to use the @salesforce/command.UX.create function in @salesforce/command

To help you get started, we’ve selected a few @salesforce/command examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eltoroit / ETCopyData / src / @ELTOROIT / ETCopyData.ts View on Github external
public exportData(overrideSettings: Settings, data: IETCopyData): Promise {
		if (!Util.doesLogOutputsEachStep()) {
			UX.create()
				.then((ux) => {
					ux.startSpinner("ETCopyData:Export");
				})
				.catch((err) => { Util.throwError(err); });
		}
		return new Promise((resolve, reject) => {
			this.initializeETCopy(overrideSettings, data)
				.then((value: IETCopyData) => {
					data = value;
				})
				.then(() => {
					// Export data
					const promises = [];

					promises.push(Exporter.all(data.orgs.get(WhichOrg.SOURCE), ""));
					// promises.push(Exporter.exportMetadata(data.orgs.get(WhichOrg.DESTINATION), ""));
github eltoroit / ETCopyData / src / @ELTOROIT / ETCopyData.ts View on Github external
public deleteData(overrideSettings: Settings, data: IETCopyData): Promise {
		if (!Util.doesLogOutputsEachStep()) {
			UX.create()
				.then((ux) => {
					ux.startSpinner("ETCopyData:Delete");
				})
				.catch((err) => { Util.throwError(err); });
		}
		return new Promise((resolve, reject) => {
			this.initializeETCopy(overrideSettings, data)
				.then((value: IETCopyData) => {
					data = value;
				})
				.then(() => {
					// Delete data
					const importer: Importer = new Importer();
					const orgDestination: OrgManager = data.orgs.get(WhichOrg.DESTINATION);
					return importer.deleteAll(orgDestination);
				})
github eltoroit / ETCopyData / src / @ELTOROIT / ETCopyData.ts View on Github external
public importData(overrideSettings: Settings, data: IETCopyData): Promise {
		if (!Util.doesLogOutputsEachStep()) {
			UX.create()
				.then((ux) => {
					ux.startSpinner("ETCopyData:Import");
				})
				.catch((err) => { Util.throwError(err); });
		}
		return new Promise((resolve, reject) => {
			this.initializeETCopy(overrideSettings, data)
				.then((value: IETCopyData) => {
					data = value;
				})
				.then(() => {
					// Import data
					const importer: Importer = new Importer();
					const orgSource: OrgManager = data.orgs.get(WhichOrg.SOURCE);
					const orgDestination: OrgManager = data.orgs.get(WhichOrg.DESTINATION);
					return importer.importAll(orgSource, orgDestination);
github eltoroit / ETCopyData / src / @ELTOROIT / Util.ts View on Github external
display: (() => {
				// LEARNING: [ARRAY]: Shadow clone of the array.
				const data = this.entries.slice(0);
				// LEARNING: Getting ux in a static method
				UX.create()
					.then((ux) => {
						ux.table(data, {
							columns: [
								{ key: "timestamp", label: "Timestamp" },
								{ key: "entryNumber", label: "#" },
								{ key: "level", label: "Level" },
								{ key: "lineNumber", label: "Line Number" },
								{ key: "description", label: "Description" },
							],
						});
					});
			}),
		};
github amtrack / sfdx-browserforce-plugin / test / browserforce.e2e-spec.ts View on Github external
it('should throw the page error on internal errors', async function() {
      this.timeout(1000 * 300);
      this.slow(1000 * 30);
      const defaultScratchOrg = await core.Org.create({});
      const ux = await UX.create();
      const bf = new Browserforce(defaultScratchOrg, ux.cli);
      await bf.login();
      process.env.BROWSERFORCE_RETRY_TIMEOUT_MS = '0';
      await assert.rejects(async () => {
        await bf.openPage(
          '_ui/common/config/field/StandardFieldAttributes/d?type=Account&id=INVALID_Name'
        );
      }, /Insufficient Privileges/);
      delete process.env.BROWSERFORCE_RETRY_TIMEOUT_MS;
      await bf.logout();
    });
    it('should not throw any error opening a page', async function() {
github eltoroit / ETCopyData / src / @ELTOROIT / ETCopyData.ts View on Github external
public compareSchemas(overrideSettings: Settings, data: IETCopyData): Promise {
		if (!Util.doesLogOutputsEachStep()) {
			UX.create()
				.then((ux) => {
					ux.startSpinner("ETCopyData:Compare");
				})
				.catch((err) => { Util.throwError(err); });
		}
		return new Promise((resolve, reject) => {
			this.initializeETCopy(overrideSettings, data)
				.then((value: IETCopyData) => {
					data = value;
				})
				.then(() => {
					resolve();
				})
				.catch((err) => { reject(err); });
		});
	}