@contrast/agent 4.16.2 → 4.18.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 (147) hide show
  1. package/esm.mjs +21 -11
  2. package/lib/assess/policy/propagators.json +4 -0
  3. package/lib/assess/policy/signatures.json +5 -0
  4. package/lib/assess/propagators/fastify-static/allowed-path.js +85 -0
  5. package/lib/assess/sources/index.js +26 -5
  6. package/lib/cli-rewriter/index.js +1 -1
  7. package/lib/contrast.js +1 -1
  8. package/lib/core/config/options.js +14 -1
  9. package/lib/core/config/util.js +39 -11
  10. package/lib/core/rewrite/index.js +2 -2
  11. package/lib/protect/service.js +2 -0
  12. package/lib/util/trace-util.js +5 -4
  13. package/node_modules/@colors/colors/LICENSE +26 -0
  14. package/node_modules/@colors/colors/README.md +219 -0
  15. package/node_modules/@colors/colors/examples/normal-usage.js +83 -0
  16. package/node_modules/@colors/colors/examples/safe-string.js +80 -0
  17. package/node_modules/@colors/colors/index.d.ts +136 -0
  18. package/node_modules/@colors/colors/lib/colors.js +211 -0
  19. package/node_modules/@colors/colors/lib/custom/trap.js +46 -0
  20. package/node_modules/@colors/colors/lib/custom/zalgo.js +110 -0
  21. package/node_modules/@colors/colors/lib/extendStringPrototype.js +110 -0
  22. package/node_modules/@colors/colors/lib/index.js +13 -0
  23. package/node_modules/@colors/colors/lib/maps/america.js +10 -0
  24. package/node_modules/@colors/colors/lib/maps/rainbow.js +12 -0
  25. package/node_modules/@colors/colors/lib/maps/random.js +11 -0
  26. package/node_modules/@colors/colors/lib/maps/zebra.js +5 -0
  27. package/node_modules/@colors/colors/lib/styles.js +95 -0
  28. package/node_modules/@colors/colors/lib/system/has-flag.js +35 -0
  29. package/node_modules/@colors/colors/lib/system/supports-colors.js +151 -0
  30. package/node_modules/@colors/colors/package.json +49 -0
  31. package/node_modules/@colors/colors/safe.d.ts +48 -0
  32. package/node_modules/@colors/colors/safe.js +10 -0
  33. package/node_modules/@colors/colors/themes/generic-logging.js +12 -0
  34. package/node_modules/@dabh/diagnostics/README.md +16 -16
  35. package/node_modules/@dabh/diagnostics/package.json +9 -9
  36. package/node_modules/color/README.md +9 -0
  37. package/node_modules/color/index.js +4 -1
  38. package/node_modules/color/package.json +8 -8
  39. package/node_modules/color-string/README.md +6 -2
  40. package/node_modules/color-string/index.js +21 -13
  41. package/node_modules/color-string/package.json +4 -4
  42. package/node_modules/colorspace/package.json +5 -5
  43. package/node_modules/fecha/dist/fecha.min.js +1 -1
  44. package/node_modules/fecha/dist/fecha.min.js.map +1 -0
  45. package/node_modules/fecha/lib/fecha.d.ts +2 -2
  46. package/node_modules/fecha/lib/fecha.js +35 -18
  47. package/node_modules/fecha/lib/fecha.js.map +1 -0
  48. package/node_modules/fecha/lib/fecha.umd.js +35 -18
  49. package/node_modules/fecha/lib/fecha.umd.js.map +1 -0
  50. package/node_modules/fecha/package.json +9 -10
  51. package/node_modules/fecha/src/fecha.ts +524 -0
  52. package/node_modules/logform/.eslintrc +1 -1
  53. package/node_modules/logform/CHANGELOG.md +24 -0
  54. package/node_modules/logform/README.md +15 -17
  55. package/node_modules/logform/browser.js +3 -1
  56. package/node_modules/logform/cli.js +1 -1
  57. package/node_modules/logform/colorize.js +2 -2
  58. package/node_modules/logform/dist/browser.js +8 -2
  59. package/node_modules/logform/dist/cli.js +2 -2
  60. package/node_modules/logform/dist/colorize.js +5 -5
  61. package/node_modules/logform/dist/errors.js +1 -1
  62. package/node_modules/logform/dist/format.js +9 -5
  63. package/node_modules/logform/dist/index.js +53 -20
  64. package/node_modules/logform/dist/json.js +7 -6
  65. package/node_modules/logform/dist/logstash.js +1 -1
  66. package/node_modules/logform/dist/pad-levels.js +4 -4
  67. package/node_modules/logform/dist/printf.js +1 -1
  68. package/node_modules/logform/dist/simple.js +1 -1
  69. package/node_modules/logform/dist/splat.js +2 -2
  70. package/node_modules/logform/dist/uncolorize.js +1 -1
  71. package/node_modules/logform/errors.js +1 -1
  72. package/node_modules/logform/index.d.ts +36 -0
  73. package/node_modules/logform/index.js +19 -20
  74. package/node_modules/logform/json.js +7 -7
  75. package/node_modules/logform/logstash.js +1 -1
  76. package/node_modules/logform/package.json +10 -9
  77. package/node_modules/logform/simple.js +1 -1
  78. package/node_modules/logform/uncolorize.js +1 -1
  79. package/node_modules/safe-stable-stringify/CHANGELOG.md +75 -0
  80. package/node_modules/safe-stable-stringify/LICENSE +21 -0
  81. package/node_modules/safe-stable-stringify/esm/package.json +4 -0
  82. package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
  83. package/node_modules/safe-stable-stringify/index.d.ts +18 -0
  84. package/node_modules/safe-stable-stringify/index.js +618 -0
  85. package/node_modules/safe-stable-stringify/package.json +69 -0
  86. package/node_modules/safe-stable-stringify/readme.md +170 -0
  87. package/node_modules/safe-stable-stringify/tsconfig.json +22 -0
  88. package/node_modules/winston/LICENSE +18 -18
  89. package/node_modules/winston/README.md +1231 -1230
  90. package/node_modules/winston/dist/winston/common.js +10 -10
  91. package/node_modules/winston/dist/winston/config/index.js +17 -17
  92. package/node_modules/winston/dist/winston/container.js +46 -46
  93. package/node_modules/winston/dist/winston/create-logger.js +28 -24
  94. package/node_modules/winston/dist/winston/exception-handler.js +49 -49
  95. package/node_modules/winston/dist/winston/exception-stream.js +27 -27
  96. package/node_modules/winston/dist/winston/logger.js +152 -138
  97. package/node_modules/winston/dist/winston/profiler.js +22 -22
  98. package/node_modules/winston/dist/winston/rejection-handler.js +54 -54
  99. package/node_modules/winston/dist/winston/tail-file.js +14 -14
  100. package/node_modules/winston/dist/winston/transports/console.js +31 -31
  101. package/node_modules/winston/dist/winston/transports/file.js +101 -101
  102. package/node_modules/winston/dist/winston/transports/http.js +119 -41
  103. package/node_modules/winston/dist/winston/transports/index.js +17 -17
  104. package/node_modules/winston/dist/winston/transports/stream.js +24 -24
  105. package/node_modules/winston/dist/winston.js +91 -97
  106. package/node_modules/winston/index.d.ts +213 -193
  107. package/node_modules/winston/lib/winston/common.js +61 -61
  108. package/node_modules/winston/lib/winston/config/index.d.ts +99 -98
  109. package/node_modules/winston/lib/winston/config/index.js +35 -35
  110. package/node_modules/winston/lib/winston/container.js +114 -114
  111. package/node_modules/winston/lib/winston/create-logger.js +104 -104
  112. package/node_modules/winston/lib/winston/exception-handler.js +245 -245
  113. package/node_modules/winston/lib/winston/exception-stream.js +54 -54
  114. package/node_modules/winston/lib/winston/logger.js +676 -667
  115. package/node_modules/winston/lib/winston/profiler.js +51 -51
  116. package/node_modules/winston/lib/winston/rejection-handler.js +251 -251
  117. package/node_modules/winston/lib/winston/tail-file.js +124 -124
  118. package/node_modules/winston/lib/winston/transports/console.js +117 -117
  119. package/node_modules/winston/lib/winston/transports/file.js +695 -695
  120. package/node_modules/winston/lib/winston/transports/http.js +267 -202
  121. package/node_modules/winston/lib/winston/transports/index.d.ts +103 -100
  122. package/node_modules/winston/lib/winston/transports/index.js +56 -56
  123. package/node_modules/winston/lib/winston/transports/stream.js +63 -63
  124. package/node_modules/winston/lib/winston.js +176 -182
  125. package/node_modules/winston/node_modules/winston-transport/.babelrc +3 -0
  126. package/node_modules/winston/node_modules/winston-transport/.eslintrc +7 -0
  127. package/node_modules/winston/node_modules/winston-transport/.gitattributes +1 -0
  128. package/node_modules/winston/node_modules/winston-transport/.nyc_output/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
  129. package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
  130. package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/index.json +1 -0
  131. package/node_modules/winston/node_modules/winston-transport/CHANGELOG.md +126 -0
  132. package/node_modules/winston/node_modules/winston-transport/LICENSE +22 -0
  133. package/node_modules/winston/node_modules/winston-transport/README.md +50 -0
  134. package/node_modules/winston/node_modules/winston-transport/dist/index.js +215 -0
  135. package/node_modules/winston/node_modules/winston-transport/dist/legacy.js +116 -0
  136. package/node_modules/winston/node_modules/winston-transport/index.d.ts +39 -0
  137. package/node_modules/winston/node_modules/winston-transport/index.js +215 -0
  138. package/node_modules/winston/node_modules/winston-transport/legacy.js +119 -0
  139. package/node_modules/winston/node_modules/winston-transport/package.json +56 -0
  140. package/node_modules/winston/package.json +76 -75
  141. package/package.json +9 -6
  142. package/node_modules/@dabh/diagnostics/example.png +0 -0
  143. package/node_modules/color-string/CHANGELOG.md +0 -18
  144. package/node_modules/colorspace/test.js +0 -14
  145. package/node_modules/fecha/CHANGELOG.md +0 -67
  146. package/node_modules/logform/.travis.yml +0 -17
  147. package/node_modules/winston/CHANGELOG.md +0 -560
@@ -1,100 +1,103 @@
1
- // Type definitions for winston 3.0
2
- // Project: https://github.com/winstonjs/winston
3
-
4
- /// <reference types="node" />
5
-
6
- import {Agent} from "http";
7
-
8
- import * as Transport from 'winston-transport';
9
-
10
- declare namespace winston {
11
- interface ConsoleTransportOptions extends Transport.TransportStreamOptions {
12
- consoleWarnLevels?: string[],
13
- stderrLevels?: string[];
14
- debugStdout?: boolean;
15
- eol?: string;
16
- }
17
-
18
- interface ConsoleTransportInstance extends Transport {
19
- name: string;
20
- stderrLevels: string[];
21
- eol: string;
22
-
23
- new(options?: ConsoleTransportOptions): ConsoleTransportInstance;
24
- }
25
-
26
- interface FileTransportOptions extends Transport.TransportStreamOptions {
27
- filename?: string;
28
- dirname?: string;
29
- options?: object;
30
- maxsize?: number;
31
- stream?: NodeJS.WritableStream;
32
- rotationFormat?: Function;
33
- zippedArchive?: boolean;
34
- maxFiles?: number;
35
- eol?: string;
36
- tailable?: boolean;
37
- }
38
-
39
- interface FileTransportInstance extends Transport {
40
- name: string;
41
- filename: string;
42
- dirname: string;
43
- options: object;
44
- maxsize: number | null;
45
- rotationFormat: Function | boolean;
46
- zippedArchive: boolean;
47
- maxFiles: number | null;
48
- eol: string;
49
- tailable: boolean;
50
-
51
- new(options?: FileTransportOptions): FileTransportInstance;
52
- }
53
-
54
- interface HttpTransportOptions extends Transport.TransportStreamOptions {
55
- ssl?: any;
56
- host?: string;
57
- port?: number;
58
- auth?: { username?: string | undefined, password?: string | undefined, bearer?: string | undefined };
59
- path?: string;
60
- agent?: Agent;
61
- headers?: object;
62
- }
63
-
64
- interface HttpTransportInstance extends Transport {
65
- name: string;
66
- ssl: boolean;
67
- host: string;
68
- port: number;
69
- auth?: { username?: string | undefined, password?: string | undefined, bearer?: string | undefined };
70
- path: string;
71
- agent?: Agent | null;
72
-
73
- new(options?: HttpTransportOptions): HttpTransportInstance;
74
- }
75
-
76
- interface StreamTransportOptions extends Transport.TransportStreamOptions {
77
- stream: NodeJS.WritableStream;
78
- eol?: string;
79
- }
80
-
81
- interface StreamTransportInstance extends Transport {
82
- eol: string;
83
-
84
- new(options?: StreamTransportOptions): StreamTransportInstance;
85
- }
86
-
87
- interface Transports {
88
- FileTransportOptions: FileTransportOptions;
89
- File: FileTransportInstance;
90
- ConsoleTransportOptions: ConsoleTransportOptions;
91
- Console: ConsoleTransportInstance;
92
- HttpTransportOptions: HttpTransportOptions;
93
- Http: HttpTransportInstance;
94
- StreamTransportOptions: StreamTransportOptions;
95
- Stream: StreamTransportInstance;
96
- }
97
- }
98
-
99
- declare const winston: winston.Transports;
100
- export = winston;
1
+ // Type definitions for winston 3.0
2
+ // Project: https://github.com/winstonjs/winston
3
+
4
+ /// <reference types="node" />
5
+
6
+ import {Agent} from "http";
7
+
8
+ import * as Transport from 'winston-transport';
9
+
10
+ declare namespace winston {
11
+ interface ConsoleTransportOptions extends Transport.TransportStreamOptions {
12
+ consoleWarnLevels?: string[],
13
+ stderrLevels?: string[];
14
+ debugStdout?: boolean;
15
+ eol?: string;
16
+ }
17
+
18
+ interface ConsoleTransportInstance extends Transport {
19
+ name: string;
20
+ stderrLevels: string[];
21
+ eol: string;
22
+
23
+ new(options?: ConsoleTransportOptions): ConsoleTransportInstance;
24
+ }
25
+
26
+ interface FileTransportOptions extends Transport.TransportStreamOptions {
27
+ filename?: string;
28
+ dirname?: string;
29
+ options?: object;
30
+ maxsize?: number;
31
+ stream?: NodeJS.WritableStream;
32
+ rotationFormat?: Function;
33
+ zippedArchive?: boolean;
34
+ maxFiles?: number;
35
+ eol?: string;
36
+ tailable?: boolean;
37
+ }
38
+
39
+ interface FileTransportInstance extends Transport {
40
+ name: string;
41
+ filename: string;
42
+ dirname: string;
43
+ options: object;
44
+ maxsize: number | null;
45
+ rotationFormat: Function | boolean;
46
+ zippedArchive: boolean;
47
+ maxFiles: number | null;
48
+ eol: string;
49
+ tailable: boolean;
50
+
51
+ new(options?: FileTransportOptions): FileTransportInstance;
52
+ }
53
+
54
+ interface HttpTransportOptions extends Transport.TransportStreamOptions {
55
+ ssl?: any;
56
+ host?: string;
57
+ port?: number;
58
+ auth?: { username?: string | undefined, password?: string | undefined, bearer?: string | undefined };
59
+ path?: string;
60
+ agent?: Agent;
61
+ headers?: object;
62
+ batch?: boolean;
63
+ batchInterval?: number;
64
+ batchCount?: number;
65
+ }
66
+
67
+ interface HttpTransportInstance extends Transport {
68
+ name: string;
69
+ ssl: boolean;
70
+ host: string;
71
+ port: number;
72
+ auth?: { username?: string | undefined, password?: string | undefined, bearer?: string | undefined };
73
+ path: string;
74
+ agent?: Agent | null;
75
+
76
+ new(options?: HttpTransportOptions): HttpTransportInstance;
77
+ }
78
+
79
+ interface StreamTransportOptions extends Transport.TransportStreamOptions {
80
+ stream: NodeJS.WritableStream;
81
+ eol?: string;
82
+ }
83
+
84
+ interface StreamTransportInstance extends Transport {
85
+ eol: string;
86
+
87
+ new(options?: StreamTransportOptions): StreamTransportInstance;
88
+ }
89
+
90
+ interface Transports {
91
+ FileTransportOptions: FileTransportOptions;
92
+ File: FileTransportInstance;
93
+ ConsoleTransportOptions: ConsoleTransportOptions;
94
+ Console: ConsoleTransportInstance;
95
+ HttpTransportOptions: HttpTransportOptions;
96
+ Http: HttpTransportInstance;
97
+ StreamTransportOptions: StreamTransportOptions;
98
+ Stream: StreamTransportInstance;
99
+ }
100
+ }
101
+
102
+ declare const winston: winston.Transports;
103
+ export = winston;
@@ -1,56 +1,56 @@
1
- /**
2
- * transports.js: Set of all transports Winston knows about.
3
- *
4
- * (C) 2010 Charlie Robbins
5
- * MIT LICENCE
6
- */
7
-
8
- 'use strict';
9
-
10
- /**
11
- * TODO: add property description.
12
- * @type {Console}
13
- */
14
- Object.defineProperty(exports, 'Console', {
15
- configurable: true,
16
- enumerable: true,
17
- get() {
18
- return require('./console');
19
- }
20
- });
21
-
22
- /**
23
- * TODO: add property description.
24
- * @type {File}
25
- */
26
- Object.defineProperty(exports, 'File', {
27
- configurable: true,
28
- enumerable: true,
29
- get() {
30
- return require('./file');
31
- }
32
- });
33
-
34
- /**
35
- * TODO: add property description.
36
- * @type {Http}
37
- */
38
- Object.defineProperty(exports, 'Http', {
39
- configurable: true,
40
- enumerable: true,
41
- get() {
42
- return require('./http');
43
- }
44
- });
45
-
46
- /**
47
- * TODO: add property description.
48
- * @type {Stream}
49
- */
50
- Object.defineProperty(exports, 'Stream', {
51
- configurable: true,
52
- enumerable: true,
53
- get() {
54
- return require('./stream');
55
- }
56
- });
1
+ /**
2
+ * transports.js: Set of all transports Winston knows about.
3
+ *
4
+ * (C) 2010 Charlie Robbins
5
+ * MIT LICENCE
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ /**
11
+ * TODO: add property description.
12
+ * @type {Console}
13
+ */
14
+ Object.defineProperty(exports, 'Console', {
15
+ configurable: true,
16
+ enumerable: true,
17
+ get() {
18
+ return require('./console');
19
+ }
20
+ });
21
+
22
+ /**
23
+ * TODO: add property description.
24
+ * @type {File}
25
+ */
26
+ Object.defineProperty(exports, 'File', {
27
+ configurable: true,
28
+ enumerable: true,
29
+ get() {
30
+ return require('./file');
31
+ }
32
+ });
33
+
34
+ /**
35
+ * TODO: add property description.
36
+ * @type {Http}
37
+ */
38
+ Object.defineProperty(exports, 'Http', {
39
+ configurable: true,
40
+ enumerable: true,
41
+ get() {
42
+ return require('./http');
43
+ }
44
+ });
45
+
46
+ /**
47
+ * TODO: add property description.
48
+ * @type {Stream}
49
+ */
50
+ Object.defineProperty(exports, 'Stream', {
51
+ configurable: true,
52
+ enumerable: true,
53
+ get() {
54
+ return require('./stream');
55
+ }
56
+ });
@@ -1,63 +1,63 @@
1
- /**
2
- * stream.js: Transport for outputting to any arbitrary stream.
3
- *
4
- * (C) 2010 Charlie Robbins
5
- * MIT LICENCE
6
- */
7
-
8
- 'use strict';
9
-
10
- const isStream = require('is-stream');
11
- const { MESSAGE } = require('triple-beam');
12
- const os = require('os');
13
- const TransportStream = require('winston-transport');
14
-
15
- /**
16
- * Transport for outputting to any arbitrary stream.
17
- * @type {Stream}
18
- * @extends {TransportStream}
19
- */
20
- module.exports = class Stream extends TransportStream {
21
- /**
22
- * Constructor function for the Console transport object responsible for
23
- * persisting log messages and metadata to a terminal or TTY.
24
- * @param {!Object} [options={}] - Options for this instance.
25
- */
26
- constructor(options = {}) {
27
- super(options);
28
-
29
- if (!options.stream || !isStream(options.stream)) {
30
- throw new Error('options.stream is required.');
31
- }
32
-
33
- // We need to listen for drain events when write() returns false. This can
34
- // make node mad at times.
35
- this._stream = options.stream;
36
- this._stream.setMaxListeners(Infinity);
37
- this.isObjectMode = options.stream._writableState.objectMode;
38
- this.eol = options.eol || os.EOL;
39
- }
40
-
41
- /**
42
- * Core logging method exposed to Winston.
43
- * @param {Object} info - TODO: add param description.
44
- * @param {Function} callback - TODO: add param description.
45
- * @returns {undefined}
46
- */
47
- log(info, callback) {
48
- setImmediate(() => this.emit('logged', info));
49
- if (this.isObjectMode) {
50
- this._stream.write(info);
51
- if (callback) {
52
- callback(); // eslint-disable-line callback-return
53
- }
54
- return;
55
- }
56
-
57
- this._stream.write(`${info[MESSAGE]}${this.eol}`);
58
- if (callback) {
59
- callback(); // eslint-disable-line callback-return
60
- }
61
- return;
62
- }
63
- };
1
+ /**
2
+ * stream.js: Transport for outputting to any arbitrary stream.
3
+ *
4
+ * (C) 2010 Charlie Robbins
5
+ * MIT LICENCE
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ const isStream = require('is-stream');
11
+ const { MESSAGE } = require('triple-beam');
12
+ const os = require('os');
13
+ const TransportStream = require('winston-transport');
14
+
15
+ /**
16
+ * Transport for outputting to any arbitrary stream.
17
+ * @type {Stream}
18
+ * @extends {TransportStream}
19
+ */
20
+ module.exports = class Stream extends TransportStream {
21
+ /**
22
+ * Constructor function for the Console transport object responsible for
23
+ * persisting log messages and metadata to a terminal or TTY.
24
+ * @param {!Object} [options={}] - Options for this instance.
25
+ */
26
+ constructor(options = {}) {
27
+ super(options);
28
+
29
+ if (!options.stream || !isStream(options.stream)) {
30
+ throw new Error('options.stream is required.');
31
+ }
32
+
33
+ // We need to listen for drain events when write() returns false. This can
34
+ // make node mad at times.
35
+ this._stream = options.stream;
36
+ this._stream.setMaxListeners(Infinity);
37
+ this.isObjectMode = options.stream._writableState.objectMode;
38
+ this.eol = (typeof options.eol === 'string') ? options.eol : os.EOL;
39
+ }
40
+
41
+ /**
42
+ * Core logging method exposed to Winston.
43
+ * @param {Object} info - TODO: add param description.
44
+ * @param {Function} callback - TODO: add param description.
45
+ * @returns {undefined}
46
+ */
47
+ log(info, callback) {
48
+ setImmediate(() => this.emit('logged', info));
49
+ if (this.isObjectMode) {
50
+ this._stream.write(info);
51
+ if (callback) {
52
+ callback(); // eslint-disable-line callback-return
53
+ }
54
+ return;
55
+ }
56
+
57
+ this._stream.write(`${info[MESSAGE]}${this.eol}`);
58
+ if (callback) {
59
+ callback(); // eslint-disable-line callback-return
60
+ }
61
+ return;
62
+ }
63
+ };