@socketsecurity/cli 0.14.94 → 0.14.96

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 (82) hide show
  1. package/dist/constants.js +3 -3
  2. package/dist/constants.js.map +1 -1
  3. package/dist/module-sync/cli.js +178 -159
  4. package/dist/module-sync/cli.js.map +1 -1
  5. package/dist/module-sync/shadow-bin.js +3 -14
  6. package/dist/module-sync/shadow-bin.js.map +1 -1
  7. package/dist/module-sync/shadow-npm-inject.js +68 -59
  8. package/dist/module-sync/shadow-npm-inject.js.map +1 -1
  9. package/dist/module-sync/shadow-npm-paths.js +16 -29
  10. package/dist/module-sync/shadow-npm-paths.js.map +1 -1
  11. package/dist/module-sync/vendor.d.ts +0 -0
  12. package/dist/module-sync/vendor.js +85829 -12598
  13. package/dist/module-sync/vendor.js.map +1 -1
  14. package/dist/require/cli.js +160 -140
  15. package/dist/require/cli.js.map +1 -1
  16. package/dist/require/shadow-bin.d.ts +5 -0
  17. package/dist/require/shadow-bin.js +104 -1
  18. package/dist/require/shadow-bin.js.map +1 -0
  19. package/dist/require/shadow-npm-inject.d.ts +1 -0
  20. package/dist/require/shadow-npm-inject.js +2335 -1
  21. package/dist/require/shadow-npm-inject.js.map +1 -0
  22. package/dist/require/shadow-npm-paths.d.ts +29 -0
  23. package/dist/require/shadow-npm-paths.js +454 -1
  24. package/dist/require/shadow-npm-paths.js.map +1 -0
  25. package/package.json +29 -29
  26. package/dist/blessed/lib/alias.js +0 -521
  27. package/dist/blessed/lib/blessed.js +0 -34
  28. package/dist/blessed/lib/colors.js +0 -492
  29. package/dist/blessed/lib/events.js +0 -197
  30. package/dist/blessed/lib/gpmclient.js +0 -247
  31. package/dist/blessed/lib/helpers.js +0 -172
  32. package/dist/blessed/lib/keys.js +0 -514
  33. package/dist/blessed/lib/program.js +0 -4532
  34. package/dist/blessed/lib/tput.js +0 -3113
  35. package/dist/blessed/lib/unicode.js +0 -914
  36. package/dist/blessed/lib/widget.js +0 -62
  37. package/dist/blessed/lib/widgets/ansiimage.js +0 -175
  38. package/dist/blessed/lib/widgets/bigtext.js +0 -172
  39. package/dist/blessed/lib/widgets/box.js +0 -36
  40. package/dist/blessed/lib/widgets/button.js +0 -64
  41. package/dist/blessed/lib/widgets/checkbox.js +0 -97
  42. package/dist/blessed/lib/widgets/element.js +0 -2873
  43. package/dist/blessed/lib/widgets/filemanager.js +0 -225
  44. package/dist/blessed/lib/widgets/form.js +0 -303
  45. package/dist/blessed/lib/widgets/image.js +0 -73
  46. package/dist/blessed/lib/widgets/input.js +0 -36
  47. package/dist/blessed/lib/widgets/layout.js +0 -251
  48. package/dist/blessed/lib/widgets/line.js +0 -61
  49. package/dist/blessed/lib/widgets/list.js +0 -654
  50. package/dist/blessed/lib/widgets/listbar.js +0 -454
  51. package/dist/blessed/lib/widgets/listtable.js +0 -267
  52. package/dist/blessed/lib/widgets/loading.js +0 -90
  53. package/dist/blessed/lib/widgets/log.js +0 -84
  54. package/dist/blessed/lib/widgets/message.js +0 -147
  55. package/dist/blessed/lib/widgets/node.js +0 -315
  56. package/dist/blessed/lib/widgets/overlayimage.js +0 -796
  57. package/dist/blessed/lib/widgets/progressbar.js +0 -168
  58. package/dist/blessed/lib/widgets/prompt.js +0 -129
  59. package/dist/blessed/lib/widgets/question.js +0 -131
  60. package/dist/blessed/lib/widgets/radiobutton.js +0 -64
  61. package/dist/blessed/lib/widgets/radioset.js +0 -38
  62. package/dist/blessed/lib/widgets/screen.js +0 -2487
  63. package/dist/blessed/lib/widgets/scrollablebox.js +0 -417
  64. package/dist/blessed/lib/widgets/scrollabletext.js +0 -37
  65. package/dist/blessed/lib/widgets/table.js +0 -385
  66. package/dist/blessed/lib/widgets/terminal.js +0 -454
  67. package/dist/blessed/lib/widgets/text.js +0 -37
  68. package/dist/blessed/lib/widgets/textarea.js +0 -378
  69. package/dist/blessed/lib/widgets/textbox.js +0 -81
  70. package/dist/blessed/lib/widgets/video.js +0 -132
  71. package/dist/blessed/usr/fonts/AUTHORS +0 -1
  72. package/dist/blessed/usr/fonts/LICENSE +0 -94
  73. package/dist/blessed/usr/fonts/README +0 -340
  74. package/dist/blessed/usr/fonts/ter-u14b.json +0 -17826
  75. package/dist/blessed/usr/fonts/ter-u14n.json +0 -17826
  76. package/dist/blessed/usr/linux +0 -0
  77. package/dist/blessed/usr/windows-ansi +0 -0
  78. package/dist/blessed/usr/xterm +0 -0
  79. package/dist/blessed/usr/xterm-256color +0 -0
  80. package/dist/blessed/usr/xterm.termcap +0 -243
  81. package/dist/blessed/usr/xterm.terminfo +0 -1977
  82. package/dist/blessed/vendor/tng.js +0 -1878
@@ -1,417 +0,0 @@
1
- 'use strict'
2
-
3
- /**
4
- * scrollablebox.js - scrollable box element for blessed
5
- * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License).
6
- * https://github.com/chjj/blessed
7
- */
8
-
9
- /**
10
- * Modules
11
- */
12
-
13
- const Node = require('./node')
14
- const Box = require('./box')
15
-
16
- /**
17
- * ScrollableBox
18
- */
19
-
20
- function ScrollableBox(options) {
21
- const self = this
22
-
23
- if (!(this instanceof Node)) {
24
- return new ScrollableBox(options)
25
- }
26
-
27
- options = options || {}
28
-
29
- Box.call(this, options)
30
-
31
- if (options.scrollable === false) {
32
- return this
33
- }
34
-
35
- this.scrollable = true
36
- this.childOffset = 0
37
- this.childBase = 0
38
- this.baseLimit = options.baseLimit || Infinity
39
- this.alwaysScroll = options.alwaysScroll
40
-
41
- this.scrollbar = options.scrollbar
42
- if (this.scrollbar) {
43
- this.scrollbar.ch = this.scrollbar.ch || ' '
44
- this.style.scrollbar = this.style.scrollbar || this.scrollbar.style
45
- if (!this.style.scrollbar) {
46
- this.style.scrollbar = {}
47
- this.style.scrollbar.fg = this.scrollbar.fg
48
- this.style.scrollbar.bg = this.scrollbar.bg
49
- this.style.scrollbar.bold = this.scrollbar.bold
50
- this.style.scrollbar.underline = this.scrollbar.underline
51
- this.style.scrollbar.inverse = this.scrollbar.inverse
52
- this.style.scrollbar.invisible = this.scrollbar.invisible
53
- }
54
- //this.scrollbar.style = this.style.scrollbar;
55
- if (this.track || this.scrollbar.track) {
56
- this.track = this.scrollbar.track || this.track
57
- this.style.track = this.style.scrollbar.track || this.style.track
58
- this.track.ch = this.track.ch || ' '
59
- this.style.track = this.style.track || this.track.style
60
- if (!this.style.track) {
61
- this.style.track = {}
62
- this.style.track.fg = this.track.fg
63
- this.style.track.bg = this.track.bg
64
- this.style.track.bold = this.track.bold
65
- this.style.track.underline = this.track.underline
66
- this.style.track.inverse = this.track.inverse
67
- this.style.track.invisible = this.track.invisible
68
- }
69
- this.track.style = this.style.track
70
- }
71
- // Allow controlling of the scrollbar via the mouse:
72
- if (options.mouse) {
73
- this.on('mousedown', function (data) {
74
- if (self._scrollingBar) {
75
- // Do not allow dragging on the scrollbar:
76
- delete self.screen._dragging
77
- delete self._drag
78
- return
79
- }
80
- const x = data.x - self.aleft
81
- const y = data.y - self.atop
82
- if (x === self.width - self.iright - 1) {
83
- // Do not allow dragging on the scrollbar:
84
- delete self.screen._dragging
85
- delete self._drag
86
- const perc = (y - self.itop) / (self.height - self.iheight)
87
- self.setScrollPerc((perc * 100) | 0)
88
- self.screen.render()
89
- let smd, smu
90
- self._scrollingBar = true
91
- self.onScreenEvent(
92
- 'mousedown',
93
- (smd = function (data) {
94
- const y = data.y - self.atop
95
- const perc = y / self.height
96
- self.setScrollPerc((perc * 100) | 0)
97
- self.screen.render()
98
- })
99
- )
100
- // If mouseup occurs out of the window, no mouseup event fires, and
101
- // scrollbar will drag again on mousedown until another mouseup
102
- // occurs.
103
- self.onScreenEvent(
104
- 'mouseup',
105
- (smu = function () {
106
- self._scrollingBar = false
107
- self.removeScreenEvent('mousedown', smd)
108
- self.removeScreenEvent('mouseup', smu)
109
- })
110
- )
111
- }
112
- })
113
- }
114
- }
115
-
116
- if (options.mouse) {
117
- this.on('wheeldown', function () {
118
- self.scroll((self.height / 2) | 0 || 1)
119
- self.screen.render()
120
- })
121
- this.on('wheelup', function () {
122
- self.scroll(-((self.height / 2) | 0) || -1)
123
- self.screen.render()
124
- })
125
- }
126
-
127
- if (options.keys && !options.ignoreKeys) {
128
- this.on('keypress', function (ch, key) {
129
- if (key.name === 'up' || (options.vi && key.name === 'k')) {
130
- self.scroll(-1)
131
- self.screen.render()
132
- return
133
- }
134
- if (key.name === 'down' || (options.vi && key.name === 'j')) {
135
- self.scroll(1)
136
- self.screen.render()
137
- return
138
- }
139
- if (options.vi && key.name === 'u' && key.ctrl) {
140
- self.scroll(-((self.height / 2) | 0) || -1)
141
- self.screen.render()
142
- return
143
- }
144
- if (options.vi && key.name === 'd' && key.ctrl) {
145
- self.scroll((self.height / 2) | 0 || 1)
146
- self.screen.render()
147
- return
148
- }
149
- if (options.vi && key.name === 'b' && key.ctrl) {
150
- self.scroll(-self.height || -1)
151
- self.screen.render()
152
- return
153
- }
154
- if (options.vi && key.name === 'f' && key.ctrl) {
155
- self.scroll(self.height || 1)
156
- self.screen.render()
157
- return
158
- }
159
- if (options.vi && key.name === 'g' && !key.shift) {
160
- self.scrollTo(0)
161
- self.screen.render()
162
- return
163
- }
164
- if (options.vi && key.name === 'g' && key.shift) {
165
- self.scrollTo(self.getScrollHeight())
166
- self.screen.render()
167
- return
168
- }
169
- })
170
- }
171
-
172
- this.on('parsed content', function () {
173
- self._recalculateIndex()
174
- })
175
-
176
- self._recalculateIndex()
177
- }
178
-
179
- Object.setPrototypeOf(ScrollableBox.prototype, Box.prototype)
180
-
181
- ScrollableBox.prototype.type = 'scrollable-box'
182
-
183
- // XXX Potentially use this in place of scrollable checks elsewhere.
184
- ScrollableBox.prototype.__defineGetter__('reallyScrollable', function () {
185
- if (this.shrink) {
186
- return this.scrollable
187
- }
188
- return this.getScrollHeight() > this.height
189
- })
190
-
191
- ScrollableBox.prototype._scrollBottom = function () {
192
- if (!this.scrollable) {
193
- return 0
194
- }
195
-
196
- // We could just calculate the children, but we can
197
- // optimize for lists by just returning the items.length.
198
- if (this._isList) {
199
- return this.items ? this.items.length : 0
200
- }
201
-
202
- if (this.lpos && this.lpos._scrollBottom) {
203
- return this.lpos._scrollBottom
204
- }
205
-
206
- const bottom = this.children.reduce(function (current, el) {
207
- // el.height alone does not calculate the shrunken height, we need to use
208
- // getCoords. A shrunken box inside a scrollable element will not grow any
209
- // larger than the scrollable element's context regardless of how much
210
- // content is in the shrunken box, unless we do this (call getCoords
211
- // without the scrollable calculation):
212
- // See: $ node test/widget-shrink-fail-2.js
213
- if (!el.detached) {
214
- const lpos = el._getCoords(false, true)
215
- if (lpos) {
216
- return Math.max(current, el.rtop + (lpos.yl - lpos.yi))
217
- }
218
- }
219
- return Math.max(current, el.rtop + el.height)
220
- }, 0)
221
-
222
- // XXX Use this? Makes .getScrollHeight() useless!
223
- // if (bottom < this._clines.length) bottom = this._clines.length;
224
-
225
- if (this.lpos) {
226
- this.lpos._scrollBottom = bottom
227
- }
228
-
229
- return bottom
230
- }
231
-
232
- ScrollableBox.prototype.setScroll = ScrollableBox.prototype.scrollTo =
233
- function (offset, always) {
234
- // XXX
235
- // At first, this appeared to account for the first new calculation of childBase:
236
- this.scroll(0)
237
- return this.scroll(offset - (this.childBase + this.childOffset), always)
238
- }
239
-
240
- ScrollableBox.prototype.getScroll = function () {
241
- return this.childBase + this.childOffset
242
- }
243
-
244
- ScrollableBox.prototype.scroll = function (offset, always) {
245
- if (!this.scrollable) {
246
- return
247
- }
248
-
249
- if (this.detached) {
250
- return
251
- }
252
-
253
- // Handle scrolling.
254
- let visible = this.height - this.iheight,
255
- base = this.childBase,
256
- d,
257
- p,
258
- t,
259
- b,
260
- max,
261
- emax
262
-
263
- if (this.alwaysScroll || always) {
264
- // Semi-workaround
265
- this.childOffset = offset > 0 ? visible - 1 + offset : offset
266
- } else {
267
- this.childOffset += offset
268
- }
269
-
270
- if (this.childOffset > visible - 1) {
271
- d = this.childOffset - (visible - 1)
272
- this.childOffset -= d
273
- this.childBase += d
274
- } else if (this.childOffset < 0) {
275
- d = this.childOffset
276
- this.childOffset += -d
277
- this.childBase += d
278
- }
279
-
280
- if (this.childBase < 0) {
281
- this.childBase = 0
282
- } else if (this.childBase > this.baseLimit) {
283
- this.childBase = this.baseLimit
284
- }
285
-
286
- // Find max "bottom" value for
287
- // content and descendant elements.
288
- // Scroll the content if necessary.
289
- if (this.childBase === base) {
290
- return this.emit('scroll')
291
- }
292
-
293
- // When scrolling text, we want to be able to handle SGR codes as well as line
294
- // feeds. This allows us to take preformatted text output from other programs
295
- // and put it in a scrollable text box.
296
- this.parseContent()
297
-
298
- // XXX
299
- // max = this.getScrollHeight() - (this.height - this.iheight);
300
-
301
- max = this._clines.length - (this.height - this.iheight)
302
- if (max < 0) {
303
- max = 0
304
- }
305
- emax = this._scrollBottom() - (this.height - this.iheight)
306
- if (emax < 0) {
307
- emax = 0
308
- }
309
-
310
- this.childBase = Math.min(this.childBase, Math.max(emax, max))
311
-
312
- if (this.childBase < 0) {
313
- this.childBase = 0
314
- } else if (this.childBase > this.baseLimit) {
315
- this.childBase = this.baseLimit
316
- }
317
-
318
- // Optimize scrolling with CSR + IL/DL.
319
- p = this.lpos
320
- // Only really need _getCoords() if we want
321
- // to allow nestable scrolling elements...
322
- // or if we **really** want shrinkable
323
- // scrolling elements.
324
- // p = this._getCoords();
325
- if (p && this.childBase !== base && this.screen.cleanSides(this)) {
326
- t = p.yi + this.itop
327
- b = p.yl - this.ibottom - 1
328
- d = this.childBase - base
329
-
330
- if (d > 0 && d < visible) {
331
- // scrolled down
332
- this.screen.deleteLine(d, t, t, b)
333
- } else if (d < 0 && -d < visible) {
334
- // scrolled up
335
- d = -d
336
- this.screen.insertLine(d, t, t, b)
337
- }
338
- }
339
-
340
- return this.emit('scroll')
341
- }
342
-
343
- ScrollableBox.prototype._recalculateIndex = function () {
344
- let max, emax
345
-
346
- if (this.detached || !this.scrollable) {
347
- return 0
348
- }
349
-
350
- // XXX
351
- // max = this.getScrollHeight() - (this.height - this.iheight);
352
-
353
- max = this._clines.length - (this.height - this.iheight)
354
- if (max < 0) {
355
- max = 0
356
- }
357
- emax = this._scrollBottom() - (this.height - this.iheight)
358
- if (emax < 0) {
359
- emax = 0
360
- }
361
-
362
- this.childBase = Math.min(this.childBase, Math.max(emax, max))
363
-
364
- if (this.childBase < 0) {
365
- this.childBase = 0
366
- } else if (this.childBase > this.baseLimit) {
367
- this.childBase = this.baseLimit
368
- }
369
- }
370
-
371
- ScrollableBox.prototype.resetScroll = function () {
372
- if (!this.scrollable) {
373
- return
374
- }
375
- this.childOffset = 0
376
- this.childBase = 0
377
- return this.emit('scroll')
378
- }
379
-
380
- ScrollableBox.prototype.getScrollHeight = function () {
381
- return Math.max(this._clines.length, this._scrollBottom())
382
- }
383
-
384
- ScrollableBox.prototype.getScrollPerc = function (s) {
385
- const pos = this.lpos || this._getCoords()
386
- if (!pos) {
387
- return s ? -1 : 0
388
- }
389
-
390
- let height = pos.yl - pos.yi - this.iheight,
391
- i = this.getScrollHeight(),
392
- p
393
-
394
- if (height < i) {
395
- if (this.alwaysScroll) {
396
- p = this.childBase / (i - height)
397
- } else {
398
- p = (this.childBase + this.childOffset) / (i - 1)
399
- }
400
- return p * 100
401
- }
402
-
403
- return s ? -1 : 0
404
- }
405
-
406
- ScrollableBox.prototype.setScrollPerc = function (i) {
407
- // XXX
408
- // var m = this.getScrollHeight();
409
- const m = Math.max(this._clines.length, this._scrollBottom())
410
- return this.scrollTo(((i / 100) * m) | 0)
411
- }
412
-
413
- /**
414
- * Expose
415
- */
416
-
417
- module.exports = ScrollableBox
@@ -1,37 +0,0 @@
1
- 'use strict'
2
-
3
- /**
4
- * scrollabletext.js - scrollable text element for blessed
5
- * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License).
6
- * https://github.com/chjj/blessed
7
- */
8
-
9
- /**
10
- * Modules
11
- */
12
-
13
- const Node = require('./node')
14
- const ScrollableBox = require('./scrollablebox')
15
-
16
- /**
17
- * ScrollableText
18
- */
19
-
20
- function ScrollableText(options) {
21
- if (!(this instanceof Node)) {
22
- return new ScrollableText(options)
23
- }
24
- options = options || {}
25
- options.alwaysScroll = true
26
- ScrollableBox.call(this, options)
27
- }
28
-
29
- Object.setPrototypeOf(ScrollableText.prototype, ScrollableBox.prototype)
30
-
31
- ScrollableText.prototype.type = 'scrollable-text'
32
-
33
- /**
34
- * Expose
35
- */
36
-
37
- module.exports = ScrollableText