snyk 1.973.0 → 1.974.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ exports.modules = {
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "__esModule", ({ value: true }));
11
- exports.isIacShareResultsOptions = exports.assertIaCOptionsFlags = exports.UnsupportedEntitlementCommandError = exports.UnsupportedEntitlementFlagError = exports.FlagValueError = exports.FeatureFlagError = exports.FlagError = void 0;
11
+ exports.InvalidArgumentError = exports.isIacShareResultsOptions = exports.assertIaCOptionsFlags = exports.UnsupportedEntitlementCommandError = exports.UnsupportedEntitlementFlagError = exports.FlagValueError = exports.FeatureFlagError = exports.FlagError = void 0;
12
12
  const errors_1 = __webpack_require__(55191);
13
13
  const args_1 = __webpack_require__(94765);
14
14
  const error_utils_1 = __webpack_require__(36401);
@@ -43,7 +43,9 @@ const keys = [
43
43
  // PolicyOptions
44
44
  'ignore-policy',
45
45
  'policy-path',
46
+ // Report options
46
47
  'remote-repo-url',
48
+ 'target-name',
47
49
  ];
48
50
  const allowed = new Set(keys);
49
51
  function camelcaseToDash(key) {
@@ -115,11 +117,11 @@ exports.UnsupportedEntitlementCommandError = UnsupportedEntitlementCommandError;
115
117
  /**
116
118
  * Validates the command line flags passed to the snyk iac test
117
119
  * command. The current argument parsing is very permissive and
118
- * allows unknown flags to be provided without valdiation.
120
+ * allows unknown flags to be provided without validation.
119
121
  *
120
- * For snyk iac we need to explictly validate the flags to avoid
122
+ * For snyk iac we need to explicitly validate the flags to avoid
121
123
  * misconfigurations and typos. For example, if the --experimental
122
- * flag were to be mis-spelled we would end up sending the client
124
+ * flag were to be misspelled we would end up sending the client
123
125
  * data to our backend rather than running it locally as intended.
124
126
  * @param argv command line args passed to the process
125
127
  */
@@ -152,6 +154,17 @@ function isIacShareResultsOptions(options) {
152
154
  return options.iac && options.report;
153
155
  }
154
156
  exports.isIacShareResultsOptions = isIacShareResultsOptions;
157
+ class InvalidArgumentError extends errors_1.CustomError {
158
+ constructor(key) {
159
+ const flag = getFlagName(key);
160
+ const msg = `Invalid argument provided to flag "${flag}". Value must be a string`;
161
+ super(msg);
162
+ this.code = types_1.IaCErrorCodes.InvalidArgumentError;
163
+ this.strCode = error_utils_1.getErrorStringCode(this.code);
164
+ this.userMessage = msg;
165
+ }
166
+ }
167
+ exports.InvalidArgumentError = InvalidArgumentError;
155
168
 
156
169
 
157
170
  /***/ }),