How to use the @salesforce/core.Messages.loadMessages function in @salesforce/core

To help you get started, we’ve selected a few @salesforce/core 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 wadewegner / sfdx-waw-plugin / src / commands / waw / auth / username / login.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { AuthInfo, Messages } from '@salesforce/core';
import { AnyJson, getString } from '@salesforce/ts-types';
import * as jsforce from 'jsforce';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ApexLogGet extends SfdxCommand {
  public static description = messages.getMessage('auth.username.login.description');
  public static examples = [];

  public static readonly flagsConfig = {
    instanceurl: flags.url({
      char: 'r',
      description: messages.getMessage('auth.username.login.flags.instanceurl')
    }),
    username: flags.string({
      char: 'u',
      description: messages.getMessage('auth.username.login.flags.username'),
      required: true
    }),
    password: flags.string({
github wadewegner / sfdx-waw-plugin / src / commands / waw / workbench / open.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Global, Messages, SfdxError } from '@salesforce/core';
import { JsonMap } from '@salesforce/ts-types';
import * as fsx from 'fs-extra';
import * as open from 'open';
import { join } from 'path';
import * as url from 'url';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ConnectedAppCreate extends SfdxCommand {
  public static description = messages.getMessage('workbench.open.description');
  public static examples = [];

  protected static flagsConfig = {
    targetworkbenchurl: flags.string({
      char: 't',
      description: messages.getMessage('workbench.open.flags.targetworkbenchurl')
    }),
    setdefaultworkbenchurl: flags.string({
      char: 's',
      description: messages.getMessage('workbench.open.flags.setdefaultworkbenchurl'),
      dependsOn: ['targetworkbenchurl']
    }),
    urlonly: flags.string({
github ChuckJonas / sfdx-git-packager / src / commands / git / package.ts View on Github external
import { dirname, isAbsolute, join, relative } from 'path';
import * as tmp from 'tmp';
import { getResolver, resolveMetadata } from '../../metadataResolvers';
import { copyFileFromRef, getIgnore, purgeFolder, spawnPromise } from '../../util';

interface DiffResults {
  changed: string[];
  removed: string[];
}

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-git-packager', 'package');

export default class Package extends SfdxCommand {

  public static description = messages.getMessage('commandDescription');

  public static examples = [
    '$ sfdx git:package -s my-awesome-feature -t master -d deploy/my-feature',
    '$ sfdx git:package -d deploy/my-feature',
    '$ sfdx git:package -s feature-b -d deploy/feature-b'
  ];

  // not sure what this does...
  public static args = [
    { name: 'file' }
  ];
github nawforce / ApexLink / assist / cli / src / commands / apexlink / check.ts View on Github external
*/

import { flags, SfdxCommand } from "@salesforce/command";
import { Messages, SfdxError } from "@salesforce/core";
import { AnyJson } from "@salesforce/ts-types";
import * as fs from "fs";
import { InfoMessages, MessageWriter, CSVWriter } from "../../api/messages";
import Org from "../../api/org";
import Server from "../../api/server";

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages("apexlink", "check");

export default class Check extends SfdxCommand {
  public static description = messages.getMessage("commandDescription");

  public static examples = [
    `$ sfdx apexlink:check`,
    `$ sfdx apexlink:check --verbose --warnings projects/myproject`,
    `$ sfdx apexlink:check --zombies --json myns=projects/base projects/extension`
  ];

  public static args = [
    {
      name: "directories",
      description:
        "list of directories to search for Apex class files, defaults to current directory\n" +
        "use [=]directory for multiple packages, packages are loaded in first seen order.\n" +
github wadewegner / sfdx-waw-plugin / src / commands / waw / codeclean / check.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import { get } from 'request-promise';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ApexLogGet extends SfdxCommand {
  public static description = messages.getMessage('codeclean.check.description');
  public static examples = [];

  public static readonly flagsConfig = {
    id: flags.string({
      char: 'i',
      description: messages.getMessage('codeclean.flags.id'),
      required: true
    })
  };

  public async run(): Promise {
    const jobId = this.flags.id;
    const checkApi = `https://sfcodeclean.herokuapp.com/api/job/status/${jobId}`;
github wadewegner / sfdx-waw-plugin / src / commands / waw / source / oss.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages, SfdxError } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import * as fs from 'fs';
import * as urlExists from 'url-exists';

import * as files from '../../../lib/files';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ConnectedAppCreate extends SfdxCommand {
  public static description = messages.getMessage('source.oss.description');
  public static examples = [];

  public static readonly flagsConfig = {
    repository: flags.string({
      char: 'r',
      description: messages.getMessage('source.oss.flags.repository'),
      required: true
    }),
    path: flags.string({
      char: 'p',
      description: messages.getMessage('source.oss.flags.path'),
      required: true
    }),
github wadewegner / sfdx-waw-plugin / src / commands / waw / connectedapp / create.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import { set } from '@salesforce/kit';
import { writeFile } from 'fs-extra';
import { MetadataInfo, SaveResult } from 'jsforce';
import * as forge from 'node-forge';
import { getSelfSignedCertificate } from '../../../lib/certs';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ConnectedAppCreate extends SfdxCommand {
  public static description = messages.getMessage('connectedapp.create.description');
  public static examples = [];

  public static readonly flagsConfig = {
    name: flags.string({
      char: 'n',
      description: messages.getMessage('connectedapp.create.flags.name'),
      required: true
    }),
    label: flags.string({
      char: 'l',
      description: messages.getMessage('connectedapp.create.flags.label')
    }),
    certificate: flags.boolean({
github wadewegner / sfdx-waw-plugin / src / commands / waw / codeclean / results.ts View on Github external
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
import { get } from 'request-promise';

// Initialize Messages with the current plugin directory
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = Messages.loadMessages('sfdx-waw-plugin', 'waw');

export default class ApexLogGet extends SfdxCommand {
  public static description = messages.getMessage('codeclean.results.description');
  public static examples = [];

  public static readonly flagsConfig = {
    id: flags.string({
      char: 'i',
      description: messages.getMessage('codeclean.flags.id'),
      required: true
    })
  };

  public async run(): Promise {
    const jobId = this.flags.id;
    const checkApi = `https://sfcodeclean.herokuapp.com/api/job/${jobId}`;