How to use the flex-dev-utils/dist/sids.isSidOfType function in flex-dev-utils

To help you get started, we’ve selected a few flex-dev-utils 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 twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / deployments.ts View on Github external
constructor(auth: AuthConfig, serviceSid: string, environmentSid: string) {
    super(auth, `${ServiceClient.getBaseUrl()}/Services/${serviceSid}/Environments/${environmentSid}`);

    if (!isSidOfType(serviceSid, 'ZS')) {
      throw new Error(`ServiceSid ${serviceSid} is not valid`);
    }

    if (!isSidOfType(environmentSid, 'ZE')) {
      throw new Error(`EnvironmentSid ${environmentSid} is not valid`);
    }
  }
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / environments.ts View on Github external
public remove = (sid: string): Promise => {
    if (!isSidOfType(sid, SidPrefix.EnvironmentSid)) {
      throw new Error(`${sid} is not of type ${SidPrefix.EnvironmentSid}`);
    }

    return this.http
      .delete(`${EnvironmentClient.BaseUri}/${sid}`);
  }
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / files.ts View on Github external
protected constructor(auth: AuthConfig, fileType: FileTypes,  serviceSid: string) {
    super(auth, `${ServiceClient.getBaseUrl()}/Services/${serviceSid}`);

    if (!isSidOfType(serviceSid, 'ZS')) {
      throw new Error(`ServiceSid ${serviceSid} is not valid`);
    }

    this.fileType = fileType;
    this.serviceSid = serviceSid;
  }
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / deployments.ts View on Github external
constructor(auth: AuthConfig, serviceSid: string, environmentSid: string) {
    super(auth, `${ServiceClient.getBaseUrl()}/Services/${serviceSid}/Environments/${environmentSid}`);

    if (!isSidOfType(serviceSid, 'ZS')) {
      throw new Error(`ServiceSid ${serviceSid} is not valid`);
    }

    if (!isSidOfType(environmentSid, 'ZE')) {
      throw new Error(`EnvironmentSid ${environmentSid} is not valid`);
    }
  }
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / environments.ts View on Github external
constructor(auth: AuthConfig, serviceSid: string) {
    super(auth, `${ServiceClient.getBaseUrl()}/Services/${serviceSid}`);

    if (!isSidOfType(serviceSid, 'ZS')) {
      throw new Error(`ServiceSid ${serviceSid} is not valid`);
    }
  }
github twilio / flex-plugin-builder / packages / create-flex-plugin / src / utils / validators.ts View on Github external
const validate = async (config: FlexPluginArguments): Promise => {
  config.name = config.name || '';

  if (!isValidPluginName(config.name)) {
    const coloredName = logger.coloredStrings.name;
    const msg = `Invalid plugin name ${coloredName(config.name)}; plugin name must start with plugin-`;
    throw new ValidationError(msg);
  }

  if (config.accountSid && !isSidOfType(config.accountSid, SidPrefix.AccountSid)) {
    config.accountSid = await _promptForAccountSid();
  }

  if (config.template && !isValidUrl(config.template)) {
    config.template = await _promptForTemplateUrl();
  }

  return config;
};
github twilio / flex-plugin-builder / packages / flex-plugin-scripts / src / clients / builds.ts View on Github external
constructor(auth: AuthConfig, serviceSid: string) {
    super(auth,  `${ServiceClient.getBaseUrl()}/Services/${serviceSid}`);

    if (!isSidOfType(serviceSid, SidPrefix.ServiceSid)) {
      throw new Error(`ServiceSid ${serviceSid} is not valid`);
    }
  }