snyk 1.773.0 → 1.774.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.
Files changed (89) hide show
  1. package/dist/cli/85.index.js +309 -0
  2. package/dist/cli/85.index.js.map +1 -0
  3. package/dist/cli/875.index.js +26 -0
  4. package/dist/cli/875.index.js.map +1 -0
  5. package/dist/cli/959.index.js +1 -1
  6. package/dist/cli/970.index.js +2912 -12
  7. package/dist/cli/970.index.js.map +1 -1
  8. package/dist/cli/commands/{help.d.ts → help/index.d.ts} +0 -0
  9. package/dist/cli/commands/help/markdown-renderer.d.ts +1 -0
  10. package/dist/cli/commands/help/reflow-text.d.ts +28 -0
  11. package/dist/cli/index.js +2 -2
  12. package/dist/cli/index.js.map +1 -1
  13. package/dist/cli/thirdPartyNotice.json +9 -0
  14. package/help/README.md +1 -45
  15. package/help/commands-md/snyk-auth.md +57 -45
  16. package/help/commands-md/snyk-code.md +71 -55
  17. package/help/commands-md/snyk-config.md +82 -61
  18. package/help/commands-md/snyk-container.md +101 -75
  19. package/help/commands-md/snyk-help.md +51 -40
  20. package/help/commands-md/snyk-iac.md +133 -101
  21. package/help/commands-md/snyk-ignore.md +63 -48
  22. package/help/commands-md/snyk-monitor.md +229 -176
  23. package/help/commands-md/snyk-policy.md +53 -41
  24. package/help/commands-md/snyk-protect.md +59 -41
  25. package/help/commands-md/snyk-test.md +229 -176
  26. package/help/commands-md/snyk-wizard.md +50 -39
  27. package/help/commands-md/snyk-woof.md +53 -41
  28. package/help/commands-md/snyk.md +31 -370
  29. package/package.json +7 -8
  30. package/dist/cli/862.index.js +0 -46
  31. package/dist/cli/862.index.js.map +0 -1
  32. package/help/_about-this-project/README.md +0 -3
  33. package/help/_about-this-project/why-we-are-bundling-dependencies.md +0 -11
  34. package/help/commands-docs/_ENVIRONMENT.md +0 -35
  35. package/help/commands-docs/_EXAMPLES.md +0 -46
  36. package/help/commands-docs/_EXIT_CODES.md +0 -8
  37. package/help/commands-docs/_NOTICES.md +0 -5
  38. package/help/commands-docs/_SNYK_COMMAND_HEADER.md +0 -54
  39. package/help/commands-docs/_SNYK_COMMAND_OPTIONS.md +0 -222
  40. package/help/commands-docs/_SNYK_GLOBAL_OPTIONS.md +0 -16
  41. package/help/commands-docs/auth.md +0 -18
  42. package/help/commands-docs/code.md +0 -37
  43. package/help/commands-docs/config.md +0 -47
  44. package/help/commands-docs/container.md +0 -63
  45. package/help/commands-docs/help.md +0 -11
  46. package/help/commands-docs/iac-examples.md +0 -24
  47. package/help/commands-docs/iac.md +0 -76
  48. package/help/commands-docs/ignore-examples.md +0 -4
  49. package/help/commands-docs/ignore.md +0 -28
  50. package/help/commands-docs/monitor.md +0 -9
  51. package/help/commands-docs/policy.md +0 -14
  52. package/help/commands-docs/protect.md +0 -14
  53. package/help/commands-docs/test.md +0 -9
  54. package/help/commands-docs/wizard.md +0 -16
  55. package/help/commands-docs/woof.md +0 -14
  56. package/help/commands-man/snyk-auth.1 +0 -84
  57. package/help/commands-man/snyk-code.1 +0 -95
  58. package/help/commands-man/snyk-config.1 +0 -107
  59. package/help/commands-man/snyk-container.1 +0 -119
  60. package/help/commands-man/snyk-help.1 +0 -73
  61. package/help/commands-man/snyk-iac.1 +0 -157
  62. package/help/commands-man/snyk-ignore.1 +0 -88
  63. package/help/commands-man/snyk-monitor.1 +0 -251
  64. package/help/commands-man/snyk-policy.1 +0 -76
  65. package/help/commands-man/snyk-protect.1 +0 -76
  66. package/help/commands-man/snyk-test.1 +0 -251
  67. package/help/commands-man/snyk-wizard.1 +0 -82
  68. package/help/commands-man/snyk-woof.1 +0 -76
  69. package/help/commands-man/snyk.1 +0 -350
  70. package/help/commands-txt/snyk-auth.txt +0 -101
  71. package/help/commands-txt/snyk-code.txt +0 -120
  72. package/help/commands-txt/snyk-config.txt +0 -128
  73. package/help/commands-txt/snyk-container.txt +0 -150
  74. package/help/commands-txt/snyk-help.txt +0 -90
  75. package/help/commands-txt/snyk-iac.txt +0 -196
  76. package/help/commands-txt/snyk-ignore.txt +0 -108
  77. package/help/commands-txt/snyk-monitor.txt +0 -357
  78. package/help/commands-txt/snyk-policy.txt +0 -93
  79. package/help/commands-txt/snyk-protect.txt +0 -97
  80. package/help/commands-txt/snyk-test.txt +0 -357
  81. package/help/commands-txt/snyk-wizard.txt +0 -104
  82. package/help/commands-txt/snyk-woof.txt +0 -94
  83. package/help/commands-txt/snyk.txt +0 -464
  84. package/help/generator/generate-docs.sh +0 -19
  85. package/help/generator/generator.ts +0 -152
  86. package/help/generator/ronn-ng.dockerfile +0 -8
  87. package/help/ide.svg +0 -1
  88. package/help/monitor.svg +0 -1
  89. package/help/snyk-cli-screenshot.png +0 -0
@@ -0,0 +1,309 @@
1
+ "use strict";
2
+ exports.id = 85;
3
+ exports.ids = [85];
4
+ exports.modules = {
5
+
6
+ /***/ 21085:
7
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
+
9
+
10
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
11
+ const fs = __webpack_require__(35747);
12
+ const path = __webpack_require__(85622);
13
+ const markdown_renderer_1 = __webpack_require__(99387);
14
+ const DEFAULT_HELP = 'snyk';
15
+ function readHelpFile(filename) {
16
+ const file = fs.readFileSync(filename, 'utf8');
17
+ return markdown_renderer_1.renderMarkdown(file);
18
+ }
19
+ async function help(item) {
20
+ if (!item || item === true || typeof item !== 'string' || item === 'help') {
21
+ item = DEFAULT_HELP;
22
+ }
23
+ // cleanse the filename to only contain letters
24
+ // aka: /\W/g but figured this was easier to read
25
+ item = item.replace(/[^a-z-]/gi, '');
26
+ try {
27
+ const filename = path.resolve(__dirname, '../../help/commands-md', // this is a relative path from the webpack dist directory
28
+ item === DEFAULT_HELP ? `${DEFAULT_HELP}.md` : `snyk-${item}.md`);
29
+ return readHelpFile(filename);
30
+ }
31
+ catch (error) {
32
+ const filename = path.resolve(__dirname, '../../help/commands-md', `${DEFAULT_HELP}.md`);
33
+ return readHelpFile(filename);
34
+ }
35
+ }
36
+ exports.default = help;
37
+
38
+
39
+ /***/ }),
40
+
41
+ /***/ 99387:
42
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
43
+
44
+
45
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
46
+ exports.renderMarkdown = void 0;
47
+ const marked_1 = __webpack_require__(30970);
48
+ const chalk_1 = __webpack_require__(32589);
49
+ const reflow_text_1 = __webpack_require__(67211);
50
+ // stateful variable to control left-padding by header level
51
+ let currentHeader = 1;
52
+ const listItemSeparator = 'LISTITEMSEPARATOR'; // Helper string for rendering ListItems
53
+ /**
54
+ * @description get padding spaces depending on the last header level used
55
+ * @returns string
56
+ */
57
+ function getLeftTextPadding() {
58
+ return ' '.repeat(currentHeader);
59
+ }
60
+ /**
61
+ * @description Reads current terminal width if available to limit column width for text-reflowing
62
+ * @returns {number}
63
+ */
64
+ const defaultMaximumLineWidth = 100;
65
+ function getIdealTextWidth(maximumLineWidth = defaultMaximumLineWidth) {
66
+ if (typeof process.stdout.columns === 'number') {
67
+ if (process.stdout.columns < maximumLineWidth) {
68
+ return process.stdout.columns - getLeftTextPadding().length - 5;
69
+ }
70
+ }
71
+ return maximumLineWidth - getLeftTextPadding().length;
72
+ }
73
+ // Marked custom renderer class
74
+ const renderer = {
75
+ em(text) {
76
+ return chalk_1.default.italic(text);
77
+ },
78
+ strong(text) {
79
+ return chalk_1.default.bold(text);
80
+ },
81
+ link(href, title, text) {
82
+ const renderedLink = chalk_1.default.bold.blueBright(href);
83
+ if (text && text !== href) {
84
+ return `${text} ${renderedLink}`;
85
+ }
86
+ return renderedLink;
87
+ },
88
+ blockquote(quote) {
89
+ return quote;
90
+ },
91
+ list(body, ordered, start) {
92
+ return (body
93
+ .split(listItemSeparator)
94
+ .map((listItem, listItemIndex) => {
95
+ const bulletPoint = ordered ? `${listItemIndex + start}. ` : '- ';
96
+ return reflow_text_1.reflowText(listItem, getIdealTextWidth())
97
+ .split('\n')
98
+ .map((listItemLine, listItemLineIndex) => {
99
+ if (!listItemLine) {
100
+ return '';
101
+ }
102
+ return `${getLeftTextPadding()}${listItemLineIndex === 0 ? bulletPoint : ' '}${listItemLine}`;
103
+ })
104
+ .join('\n');
105
+ })
106
+ .join('\n') + '\n');
107
+ },
108
+ listitem(text) {
109
+ return text + listItemSeparator;
110
+ },
111
+ paragraph(text) {
112
+ return (reflow_text_1.reflowText(text, getIdealTextWidth())
113
+ .split('\n')
114
+ .map((s) => getLeftTextPadding() + chalk_1.default.reset() + s)
115
+ .join('\n') + '\n\n');
116
+ },
117
+ codespan(text) {
118
+ return chalk_1.default.italic.blueBright(`${text}`);
119
+ },
120
+ code(code) {
121
+ return code + '\n';
122
+ },
123
+ heading(text, level) {
124
+ currentHeader = level;
125
+ let coloring;
126
+ switch (level) {
127
+ case 1:
128
+ coloring = chalk_1.default.bold.underline;
129
+ break;
130
+ case 3:
131
+ case 4:
132
+ coloring = chalk_1.default;
133
+ break;
134
+ default:
135
+ coloring = chalk_1.default.bold;
136
+ break;
137
+ }
138
+ return `${' '.repeat(level === 1 ? 0 : currentHeader - 2)}${coloring(text)}\n`;
139
+ },
140
+ };
141
+ marked_1.marked.use({ renderer });
142
+ marked_1.marked.setOptions({
143
+ mangle: false,
144
+ });
145
+ const htmlUnescapes = {
146
+ '&amp;': '&',
147
+ '&lt;': '<',
148
+ '&gt;': '>',
149
+ '&quot;': '"',
150
+ '&#39;': "'",
151
+ '&#96;': '`',
152
+ };
153
+ /**
154
+ * @description Replace HTML entities with their non-encoded variant
155
+ * @param {string} text
156
+ * @returns {string}
157
+ */
158
+ function unescape(text) {
159
+ Object.entries(htmlUnescapes).forEach(([escapedChar, unescapedChar]) => {
160
+ const escapedCharRegExp = new RegExp(escapedChar, 'g');
161
+ text = text.replace(escapedCharRegExp, unescapedChar);
162
+ });
163
+ return text;
164
+ }
165
+ function renderMarkdown(markdown) {
166
+ return unescape(marked_1.marked.parse(markdown));
167
+ }
168
+ exports.renderMarkdown = renderMarkdown;
169
+
170
+
171
+ /***/ }),
172
+
173
+ /***/ 67211:
174
+ /***/ ((__unused_webpack_module, exports) => {
175
+
176
+
177
+ /**
178
+ Code in this file is adapted from mikaelbr/marked-terminal
179
+ https://github.com/mikaelbr/marked-terminal/blob/7501b8bb24a5ed52ec7d9114d4aeefa14f1bf5e6/index.js#L234-L330
180
+
181
+
182
+ MIT License
183
+
184
+ Copyright (c) 2017 Mikael Brevik
185
+
186
+ Permission is hereby granted, free of charge, to any person obtaining a copy
187
+ of this software and associated documentation files (the "Software"), to deal
188
+ in the Software without restriction, including without limitation the rights
189
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
190
+ copies of the Software, and to permit persons to whom the Software is
191
+ furnished to do so, subject to the following conditions:
192
+
193
+ The above copyright notice and this permission notice shall be included in all
194
+ copies or substantial portions of the Software.
195
+
196
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
197
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
198
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
199
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
200
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
201
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
202
+ SOFTWARE.
203
+ */
204
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
205
+ exports.reflowText = void 0;
206
+ // Compute length of str not including ANSI escape codes.
207
+ // See http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
208
+ function textLength(str) {
209
+ // eslint-disable-next-line no-control-regex
210
+ return str.replace(/\u001b\[(?:\d{1,3})(?:;\d{1,3})*m/g, '').length;
211
+ }
212
+ // Munge \n's and spaces in "text" so that the number of
213
+ // characters between \n's is less than or equal to "width".
214
+ function reflowText(text, width) {
215
+ const HARD_RETURN = '\r|\n';
216
+ const HARD_RETURN_GFM_RE = new RegExp(HARD_RETURN + '|<br />');
217
+ const splitRe = HARD_RETURN_GFM_RE;
218
+ const sections = text.split(splitRe);
219
+ const reflowed = [];
220
+ sections.forEach((section) => {
221
+ // Split the section by escape codes so that we can
222
+ // deal with them separately.
223
+ // eslint-disable-next-line no-control-regex
224
+ const fragments = section.split(/(\u001b\[(?:\d{1,3})(?:;\d{1,3})*m)/g);
225
+ let column = 0;
226
+ let currentLine = '';
227
+ let lastWasEscapeChar = false;
228
+ while (fragments.length) {
229
+ const fragment = fragments[0];
230
+ if (fragment === '') {
231
+ fragments.splice(0, 1);
232
+ lastWasEscapeChar = false;
233
+ continue;
234
+ }
235
+ // This is an escape code - leave it whole and
236
+ // move to the next fragment.
237
+ if (!textLength(fragment)) {
238
+ currentLine += fragment;
239
+ fragments.splice(0, 1);
240
+ lastWasEscapeChar = true;
241
+ continue;
242
+ }
243
+ const words = fragment.split(/[ \t\n]+/);
244
+ for (let i = 0; i < words.length; i++) {
245
+ let word = words[i];
246
+ let addSpace = column != 0;
247
+ if (lastWasEscapeChar)
248
+ addSpace = false;
249
+ // If adding the new word overflows the required width
250
+ if (column + word.length > width) {
251
+ if (word.length <= width) {
252
+ // If the new word is smaller than the required width
253
+ // just add it at the beginning of a new line
254
+ reflowed.push(currentLine);
255
+ currentLine = word;
256
+ column = word.length;
257
+ }
258
+ else {
259
+ // If the new word is longer than the required width
260
+ // split this word into smaller parts.
261
+ const w = word.substr(0, width - column);
262
+ if (addSpace)
263
+ currentLine += ' ';
264
+ currentLine += w;
265
+ reflowed.push(currentLine);
266
+ currentLine = '';
267
+ column = 0;
268
+ word = word.substr(w.length);
269
+ while (word.length) {
270
+ const w = word.substr(0, width);
271
+ if (!w.length)
272
+ break;
273
+ if (w.length < width) {
274
+ currentLine = w;
275
+ column = w.length;
276
+ break;
277
+ }
278
+ else {
279
+ reflowed.push(w);
280
+ word = word.substr(width);
281
+ }
282
+ }
283
+ }
284
+ }
285
+ else {
286
+ if (addSpace) {
287
+ currentLine += ' ';
288
+ column++;
289
+ }
290
+ currentLine += word;
291
+ column += word.length;
292
+ }
293
+ lastWasEscapeChar = false;
294
+ }
295
+ fragments.splice(0, 1);
296
+ }
297
+ if (textLength(currentLine))
298
+ reflowed.push(currentLine);
299
+ });
300
+ return reflowed.join('\n');
301
+ }
302
+ exports.reflowText = reflowText;
303
+
304
+
305
+ /***/ })
306
+
307
+ };
308
+ ;
309
+ //# sourceMappingURL=85.index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"85.index.js","mappings":";;;;;;;;;;AAAA,sCAAyB;AACzB,wCAA6B;AAC7B,uDAAqD;AAErD,MAAM,YAAY,GAAG,MAAM,CAAC;AAE5B,SAAS,YAAY,CAAC,QAAgB;IACpC,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,kCAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAEc,KAAK,UAAU,IAAI,CAAC,IAAuB;IACxD,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,MAAM,EAAE;QACzE,IAAI,GAAG,YAAY,CAAC;KACrB;IAED,+CAA+C;IAC/C,iDAAiD;IACjD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAErC,IAAI;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAC3B,SAAS,EACT,wBAAwB,EAAE,0DAA0D;QACpF,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,KAAK,CACjE,CAAC;QACF,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;KAC/B;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC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AC,WAAW,CAAC,CAAC;wBAC3B,WAAW,GAAG,EAAE,CAAC;wBACjB,MAAM,GAAG,CAAC,CAAC;wBAEX,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;wBAC7B,OAAO,IAAI,CAAC,MAAM,EAAE;4BAClB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;4BAEhC,IAAI,CAAC,CAAC,CAAC,MAAM;gCAAE,MAAM;4BAErB,IAAI,CAAC,CAAC,MAAM,GAAG,KAAK,EAAE;gCACpB,WAAW,GAAG,CAAC,CAAC;gCAChB,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;gCAClB,MAAM;6BACP;iCAAM;gCACL,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gCACjB,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;6BAC3B;yBACF;qBACF;iBACF;qBAAM;oBACL,IAAI,QAAQ,EAAE;wBACZ,WAAW,IAAI,GAAG,CAAC;wBACnB,MAAM,EAAE,CAAC;qBACV;oBAED,WAAW,IAAI,IAAI,CAAC;oBACpB,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;iBACvB;gBAED,iBAAiB,GAAG,KAAK,CAAC;aAC3B;YAED,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACxB;QAED,IAAI,UAAU,CAAC,WAAW,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAhGD,gCAgGC","sources":["webpack://snyk/./src/cli/commands/help/index.ts","webpack://snyk/./src/cli/commands/help/markdown-renderer.ts","webpack://snyk/./src/cli/commands/help/reflow-text.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport { renderMarkdown } from './markdown-renderer';\n\nconst DEFAULT_HELP = 'snyk';\n\nfunction readHelpFile(filename: string): string {\n const file = fs.readFileSync(filename, 'utf8');\n return renderMarkdown(file);\n}\n\nexport default async function help(item?: string | boolean): Promise<string> {\n if (!item || item === true || typeof item !== 'string' || item === 'help') {\n item = DEFAULT_HELP;\n }\n\n // cleanse the filename to only contain letters\n // aka: /\\W/g but figured this was easier to read\n item = item.replace(/[^a-z-]/gi, '');\n\n try {\n const filename = path.resolve(\n __dirname,\n '../../help/commands-md', // this is a relative path from the webpack dist directory\n item === DEFAULT_HELP ? `${DEFAULT_HELP}.md` : `snyk-${item}.md`,\n );\n return readHelpFile(filename);\n } catch (error) {\n const filename = path.resolve(\n __dirname,\n '../../help/commands-md',\n `${DEFAULT_HELP}.md`,\n );\n return readHelpFile(filename);\n }\n}\n","import { marked } from 'marked';\nimport chalk from 'chalk';\nimport { reflowText } from './reflow-text';\n\n// stateful variable to control left-padding by header level\nlet currentHeader = 1;\nconst listItemSeparator = 'LISTITEMSEPARATOR'; // Helper string for rendering ListItems\n\n/**\n * @description get padding spaces depending on the last header level used\n * @returns string\n */\nfunction getLeftTextPadding(): string {\n return ' '.repeat(currentHeader);\n}\n\n/**\n * @description Reads current terminal width if available to limit column width for text-reflowing\n * @returns {number}\n */\nconst defaultMaximumLineWidth = 100;\nfunction getIdealTextWidth(maximumLineWidth = defaultMaximumLineWidth): number {\n if (typeof process.stdout.columns === 'number') {\n if (process.stdout.columns < maximumLineWidth) {\n return process.stdout.columns - getLeftTextPadding().length - 5;\n }\n }\n return maximumLineWidth - getLeftTextPadding().length;\n}\n\n// Marked custom renderer class\nconst renderer = {\n em(text) {\n return chalk.italic(text);\n },\n strong(text) {\n return chalk.bold(text);\n },\n link(href, title, text) {\n const renderedLink = chalk.bold.blueBright(href);\n if (text && text !== href) {\n return `${text} ${renderedLink}`;\n }\n return renderedLink;\n },\n blockquote(quote) {\n return quote;\n },\n list(body, ordered, start) {\n return (\n body\n .split(listItemSeparator)\n .map((listItem, listItemIndex) => {\n const bulletPoint = ordered ? `${listItemIndex + start}. ` : '- ';\n return reflowText(listItem, getIdealTextWidth())\n .split('\\n')\n .map((listItemLine, listItemLineIndex) => {\n if (!listItemLine) {\n return '';\n }\n return `${getLeftTextPadding()}${\n listItemLineIndex === 0 ? bulletPoint : ' '\n }${listItemLine}`;\n })\n .join('\\n');\n })\n .join('\\n') + '\\n'\n );\n },\n listitem(text) {\n return text + listItemSeparator;\n },\n paragraph(text) {\n return (\n reflowText(text, getIdealTextWidth())\n .split('\\n')\n .map((s) => getLeftTextPadding() + chalk.reset() + s)\n .join('\\n') + '\\n\\n'\n );\n },\n codespan(text) {\n return chalk.italic.blueBright(`${text}`);\n },\n code(code) {\n return code + '\\n';\n },\n heading(text, level) {\n currentHeader = level;\n let coloring;\n switch (level) {\n case 1:\n coloring = chalk.bold.underline;\n break;\n case 3:\n case 4:\n coloring = chalk;\n break;\n default:\n coloring = chalk.bold;\n break;\n }\n return `${' '.repeat(level === 1 ? 0 : currentHeader - 2)}${coloring(\n text,\n )}\\n`;\n },\n};\n\nmarked.use({ renderer });\nmarked.setOptions({\n mangle: false,\n});\n\nconst htmlUnescapes = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': \"'\",\n '&#96;': '`',\n};\n\n/**\n * @description Replace HTML entities with their non-encoded variant\n * @param {string} text\n * @returns {string}\n */\nfunction unescape(text: string): string {\n Object.entries(htmlUnescapes).forEach(([escapedChar, unescapedChar]) => {\n const escapedCharRegExp = new RegExp(escapedChar, 'g');\n text = text.replace(escapedCharRegExp, unescapedChar);\n });\n return text;\n}\n\nexport function renderMarkdown(markdown: string): string {\n return unescape(marked.parse(markdown));\n}\n","/**\nCode in this file is adapted from mikaelbr/marked-terminal\nhttps://github.com/mikaelbr/marked-terminal/blob/7501b8bb24a5ed52ec7d9114d4aeefa14f1bf5e6/index.js#L234-L330\n\n\nMIT License\n\nCopyright (c) 2017 Mikael Brevik\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n */\n\n// Compute length of str not including ANSI escape codes.\n// See http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\nfunction textLength(str: string): number {\n // eslint-disable-next-line no-control-regex\n return str.replace(/\\u001b\\[(?:\\d{1,3})(?:;\\d{1,3})*m/g, '').length;\n}\n\n// Munge \\n's and spaces in \"text\" so that the number of\n// characters between \\n's is less than or equal to \"width\".\nexport function reflowText(text: string, width: number): string {\n const HARD_RETURN = '\\r|\\n';\n const HARD_RETURN_GFM_RE = new RegExp(HARD_RETURN + '|<br />');\n\n const splitRe = HARD_RETURN_GFM_RE;\n const sections = text.split(splitRe);\n const reflowed = [] as string[];\n\n sections.forEach((section) => {\n // Split the section by escape codes so that we can\n // deal with them separately.\n // eslint-disable-next-line no-control-regex\n const fragments = section.split(/(\\u001b\\[(?:\\d{1,3})(?:;\\d{1,3})*m)/g);\n let column = 0;\n let currentLine = '';\n let lastWasEscapeChar = false;\n\n while (fragments.length) {\n const fragment = fragments[0];\n\n if (fragment === '') {\n fragments.splice(0, 1);\n lastWasEscapeChar = false;\n continue;\n }\n\n // This is an escape code - leave it whole and\n // move to the next fragment.\n if (!textLength(fragment)) {\n currentLine += fragment;\n fragments.splice(0, 1);\n lastWasEscapeChar = true;\n continue;\n }\n\n const words = fragment.split(/[ \\t\\n]+/);\n\n for (let i = 0; i < words.length; i++) {\n let word = words[i];\n let addSpace = column != 0;\n if (lastWasEscapeChar) addSpace = false;\n\n // If adding the new word overflows the required width\n if (column + word.length > width) {\n if (word.length <= width) {\n // If the new word is smaller than the required width\n // just add it at the beginning of a new line\n reflowed.push(currentLine);\n currentLine = word;\n column = word.length;\n } else {\n // If the new word is longer than the required width\n // split this word into smaller parts.\n const w = word.substr(0, width - column);\n if (addSpace) currentLine += ' ';\n currentLine += w;\n reflowed.push(currentLine);\n currentLine = '';\n column = 0;\n\n word = word.substr(w.length);\n while (word.length) {\n const w = word.substr(0, width);\n\n if (!w.length) break;\n\n if (w.length < width) {\n currentLine = w;\n column = w.length;\n break;\n } else {\n reflowed.push(w);\n word = word.substr(width);\n }\n }\n }\n } else {\n if (addSpace) {\n currentLine += ' ';\n column++;\n }\n\n currentLine += word;\n column += word.length;\n }\n\n lastWasEscapeChar = false;\n }\n\n fragments.splice(0, 1);\n }\n\n if (textLength(currentLine)) reflowed.push(currentLine);\n });\n\n return reflowed.join('\\n');\n}\n"],"names":[],"sourceRoot":""}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ exports.id = 875;
3
+ exports.ids = [875];
4
+ exports.modules = {
5
+
6
+ /***/ 74970:
7
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
+
9
+
10
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
11
+ const version_1 = __webpack_require__(38217);
12
+ async function version() {
13
+ let version = await version_1.getVersion();
14
+ if (version_1.isStandaloneBuild()) {
15
+ version += ' (standalone)';
16
+ }
17
+ return version;
18
+ }
19
+ exports.default = version;
20
+
21
+
22
+ /***/ })
23
+
24
+ };
25
+ ;
26
+ //# sourceMappingURL=875.index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"875.index.js","mappings":";;;;;;;;;;AAAA,6CAAkE;AAEnD,KAAK,UAAU,OAAO;IACnC,IAAI,OAAO,GAAG,MAAM,oBAAU,EAAE,CAAC;IACjC,IAAI,2BAAiB,EAAE,EAAE;QACvB,OAAO,IAAI,eAAe,CAAC;KAC5B;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAND,0BAMC","sources":["webpack://snyk/./src/cli/commands/version.ts"],"sourcesContent":["import { getVersion, isStandaloneBuild } from '../../lib/version';\n\nexport default async function version() {\n let version = await getVersion();\n if (isStandaloneBuild()) {\n version += ' (standalone)';\n }\n return version;\n}\n"],"names":[],"sourceRoot":""}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.id = 959;
3
- exports.ids = [959,970];
3
+ exports.ids = [959,875];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 71771: