@vyriy/handler 0.1.12 → 0.1.13

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/README.md CHANGED
@@ -253,16 +253,16 @@ Options:
253
253
  ```
254
254
 
255
255
  - `enabled`
256
- Turns chaos injection on. By default the wrapper reads `CHAOS_ENABLED` from `@vyriy/env`.
256
+ Turns chaos injection on. By default the wrapper reads `CHAOS_ENABLED` through `@vyriy/config`.
257
257
 
258
258
  - `probability`
259
- Probability from `0` to `1` that a failure is injected. By default the wrapper reads `CHAOS_PROBABILITY`.
259
+ Probability from `0` to `1` that a failure is injected.
260
260
 
261
261
  - `strategy`
262
262
  Chooses whether to throw an error, wait and time out, or pick one randomly. Defaults to `'random'`.
263
263
 
264
264
  - `timeoutMs`
265
- Timeout delay used when the timeout strategy is selected. By default the wrapper reads `CHAOS_TIMEOUT_MS`.
265
+ Timeout delay used when the timeout strategy is selected. By default the wrapper reads `CHAOS_TIMEOUT_MS` through `@vyriy/config`.
266
266
 
267
267
  - `error`
268
268
  Error value normalized through `@vyriy/error` when the error strategy is selected.
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@vyriy/handler",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Composable AWS Lambda handler chains and wrappers for Vyriy projects",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "dependencies": {
8
8
  "@types/aws-lambda": "^8.10.161",
9
- "@vyriy/chaos": "0.1.12",
10
- "@vyriy/env": "0.1.12",
11
- "@vyriy/logger": "0.1.12",
12
- "@vyriy/smoke": "0.1.12",
13
- "@vyriy/timeout": "0.1.12"
9
+ "@vyriy/chaos": "0.1.13",
10
+ "@vyriy/config": "0.1.13",
11
+ "@vyriy/logger": "0.1.13",
12
+ "@vyriy/smoke": "0.1.13",
13
+ "@vyriy/timeout": "0.1.13"
14
14
  },
15
15
  "license": "MIT",
16
16
  "repository": {
package/wrapper/chaos.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { chaos } from '@vyriy/chaos';
2
- import { getChaosEnabled, getChaosErrorEnabled, getChaosTimeoutEnabled, getChaosTimeoutMs } from '@vyriy/env';
2
+ import { getConfig } from '@vyriy/config';
3
3
  import { factory } from '../factory.js';
4
+ const getChaosEnabled = () => getConfig('CHAOS_ENABLED', false, 'boolean');
5
+ const getChaosErrorEnabled = () => getConfig('CHAOS_ERROR_ENABLED', true, 'boolean');
6
+ const getChaosTimeoutEnabled = () => getConfig('CHAOS_TIMEOUT_ENABLED', true, 'boolean');
7
+ const getChaosTimeoutMs = () => getConfig('CHAOS_TIMEOUT_MS', 10000, 'number');
4
8
  const getStrategy = (options) => {
5
9
  if (options.strategy) {
6
10
  return options.strategy;