assert-iac-options-flag.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { CustomError } from '../../../../../lib/errors';
  2. import { Options, TestOptions } from '../../../../../lib/types';
  3. export declare class FlagError extends CustomError {
  4. constructor(key: string);
  5. }
  6. export declare class FeatureFlagError extends CustomError {
  7. constructor(key: string, featureFlag: string, hasSnykPreview?: boolean);
  8. }
  9. export declare class FlagValueError extends CustomError {
  10. constructor(key: string, value: string, supportedValues: string);
  11. }
  12. export declare class UnsupportedEntitlementFlagError extends CustomError {
  13. constructor(key: string, entitlementName: string);
  14. }
  15. export declare class UnsupportedEntitlementCommandError extends CustomError {
  16. constructor(key: string, entitlementName: string);
  17. }
  18. /**
  19. * Validates the command line flags passed to the snyk iac test
  20. * command. The current argument parsing is very permissive and
  21. * allows unknown flags to be provided without validation.
  22. *
  23. * For snyk iac we need to explicitly validate the flags to avoid
  24. * misconfigurations and typos. For example, if the --experimental
  25. * flag were to be misspelled we would end up sending the client
  26. * data to our backend rather than running it locally as intended.
  27. * @param argv command line args passed to the process
  28. */
  29. export declare function assertIaCOptionsFlags(argv: string[]): void;
  30. export declare function assertTerraformPlanModes(scanModeArgValue: string): void;
  31. export declare function isIacShareResultsOptions(options: Options & TestOptions): boolean | undefined;
  32. export declare class InvalidArgumentError extends CustomError {
  33. constructor(key: string);
  34. }