@contrast/config 1.21.0 → 1.23.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.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright: 2023 Contrast Security, Inc
1
+ Copyright: 2024 Contrast Security, Inc
2
2
  Contact: support@contrastsecurity.com
3
3
  License: Commercial
4
4
 
package/lib/common.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
package/lib/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
@@ -34,6 +34,7 @@ const {
34
34
 
35
35
  const CONTRAST_CONFIG_PATH = 'CONTRAST_CONFIG_PATH';
36
36
  const CONTRAST_PREFIX = 'CONTRAST_';
37
+ const HOME_CONFIG_DIR = path.resolve(os.homedir(), '.config', 'contrast');
37
38
  const OS_CONFIG_DIR = os.platform() === 'win32'
38
39
  ? path.resolve(process.env.ProgramData || '', 'contrast')
39
40
  : '/etc/contrast';
@@ -130,7 +131,8 @@ module.exports = class Config {
130
131
  process.cwd(),
131
132
  path.resolve(OS_CONFIG_DIR, 'node'),
132
133
  OS_CONFIG_DIR,
133
- path.resolve(os.homedir(), '.config', 'contrast'),
134
+ path.resolve(HOME_CONFIG_DIR, 'node'),
135
+ HOME_CONFIG_DIR,
134
136
  ];
135
137
  }
136
138
 
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
@@ -192,7 +192,7 @@ export interface Config {
192
192
  reporting: {
193
193
  /** Default: `true` */
194
194
  enable: boolean;
195
- /** Default: `1` */
195
+ /** Default: `100` */
196
196
  interval_ms: number;
197
197
  };
198
198
  };
@@ -202,6 +202,8 @@ export interface Config {
202
202
  /** 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.' Default: `5000` */
203
203
  warn_ms: number;
204
204
  };
205
+ /** Set the full path of the npm executable, used for library analysis. Default: `'npm'` */
206
+ npm_path: string;
205
207
  };
206
208
  };
207
209
 
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
package/lib/options.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright: 2023 Contrast Security, Inc
2
+ * Copyright: 2024 Contrast Security, Inc
3
3
  * Contact: support@contrastsecurity.com
4
4
  * License: Commercial
5
5
 
@@ -433,7 +433,8 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
433
433
  {
434
434
  name: 'agent.node.library_usage.reporting.interval_ms',
435
435
  arg: '<num>',
436
- default: 1,
436
+ fn: parseNum,
437
+ default: 100,
437
438
  desc: 'Set the interval (in milliseconds) for collecting code events for library usage.',
438
439
  },
439
440
  {
@@ -450,6 +451,12 @@ Example - \`/opt/Contrast/contrast.log\` creates a log in the \`/opt/Contrast\`
450
451
  fn: parseNum,
451
452
  desc: 'Set the response duration (in milliseconds) after which we will warn that a request has been hanging.'
452
453
  },
454
+ {
455
+ name: 'agent.node.npm_path',
456
+ arg: '<path>',
457
+ default: 'npm',
458
+ desc: 'Set the full path of the npm executable, used for library analysis',
459
+ },
453
460
  // inventory
454
461
  {
455
462
  name: 'inventory.analyze_libraries',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/config",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "description": "An API for discovering Contrast agent configuration data",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -17,7 +17,7 @@
17
17
  "test": "../scripts/test.sh"
18
18
  },
19
19
  "dependencies": {
20
- "@contrast/common": "1.15.1",
20
+ "@contrast/common": "1.16.0",
21
21
  "yaml": "^2.2.2"
22
22
  }
23
23
  }