@akshatv21/chaosproxy 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 akshatV21
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # ChaosProxy
2
+
3
+ **The localhost saboteur. Test your UI's resilience by breaking your API on purpose.**
4
+
5
+ ![NPM Version](https://img.shields.io/npm/v/chaos-proxy?style=flat-square) ![License](https://img.shields.io/npm/l/chaos-proxy?style=flat-square) ![Build Status](https://img.shields.io/github/actions/workflow/status/anomalyco/chaosproxy/build.yml?style=flat-square)
6
+
7
+ ---
8
+
9
+ ## 🚩 The Problem
10
+
11
+ Local development environments are **too perfect**. On `localhost`, requests are instantaneous and servers never fail. But in the real world, networks are flaky, APIs time out, and dependencies crash.
12
+
13
+ If you only test against a "perfect" backend, you're ignoring the most critical parts of your User Experience: **Loading states, Error boundaries, and Network retry logic.**
14
+
15
+ **ChaosProxy** solves this by sitting between your frontend and your backend, intentionally injecting chaos into your requests so you can build a truly resilient application.
16
+
17
+ ## 🚀 Installation
18
+
19
+ Install ChaosProxy globally via npm:
20
+
21
+ ```bash
22
+ npm install -g chaos-proxy
23
+ ```
24
+
25
+ ## ⚡ Quick Start
26
+
27
+ The fastest way to start is by using CLI flags. Proxy your traffic to a backend running on port `8080`, listen on port `3000`, and add a static `500ms` delay to every request:
28
+
29
+ ```bash
30
+ chaosproxy start -t http://localhost:8080 -p 3000 -d 500
31
+ ```
32
+
33
+ **What happens next?**
34
+ ChaosProxy will spin up a reverse proxy. Any request sent to `http://localhost:3000` will be forwarded to your backend after a 500ms pause. You'll see a beautiful, color-coded log in your terminal for every intercepted request.
35
+
36
+ ## 🛠️ Advanced Configuration
37
+
38
+ While flags are great for quick tests, the real power of ChaosProxy lies in the `chaos.json` configuration file. This allows you to define global rules and specific overrides for different API endpoints.
39
+
40
+ ### Example `chaos.json`
41
+
42
+ ```json
43
+ {
44
+ "server": {
45
+ "port": 3000,
46
+ "target": "http://localhost:8080"
47
+ },
48
+ "global": {
49
+ "delay": "100-500",
50
+ "failure": {
51
+ "rate": 0.05,
52
+ "codes": [500]
53
+ }
54
+ },
55
+ "routes": [
56
+ {
57
+ "path": "/api/health",
58
+ "delay": 0,
59
+ "failure": { "rate": 0 }
60
+ },
61
+ {
62
+ "path": "/api/checkout",
63
+ "method": "POST",
64
+ "delay": 2000,
65
+ "failure": {
66
+ "rate": 0.5,
67
+ "codes": [500, 503]
68
+ }
69
+ },
70
+ {
71
+ "path": "/api/users/:id",
72
+ "delay": "200-1000"
73
+ }
74
+ ]
75
+ }
76
+ ```
77
+
78
+ ### Configuration Schema
79
+
80
+ | Property | Path | Type | Description |
81
+ | :------- | :-------------------------------- | :------------------- | :------------------------------------------------------------- |
82
+ | `port` | `server.port` | `number` | The local port ChaosProxy listens on. (Default: `3000`) |
83
+ | `target` | `server.target` | `string` | The destination backend URL. (**Required**) |
84
+ | `delay` | `global.delay` / `routes[].delay` | `number` \| `string` | A static value (e.g., `500`) or a range (e.g., `"150-500"`). |
85
+ | `rate` | `global.failure.rate` | `number` | Probability of failure (0.0 to 1.0). `0.1` = 10% chance. |
86
+ | `codes` | `global.failure.codes` | `number[]` | List of HTTP status codes to randomly return on failure. |
87
+ | `path` | `routes[].path` | `string` | Endpoint pattern. Supports dynamic segments (e.g., `:id`). |
88
+ | `method` | `routes[].method` | `string` | HTTP method (GET, POST, etc). If omitted, matches all methods. |
89
+
90
+ > [!TIP]
91
+ > **Precedence Rule:** Route-specific configurations always override global configurations. If a route is matched but doesn't define a specific property (like `failure`), it will fall back to the global setting.
92
+
93
+ ## 📖 CLI Reference
94
+
95
+ | Flag | Alias | Description | Example |
96
+ | :--------- | :---- | :---------------------------------- | :------------------------- |
97
+ | `--target` | `-t` | The backend URL to proxy to. | `-t http://localhost:8080` |
98
+ | `--port` | `-p` | The local port to listen on. | `-p 3000` |
99
+ | `--delay` | `-d` | Inline delay (static or range). | `-d 100-500` |
100
+ | `--config` | `-c` | Path to a `chaos.json` config file. | `-c ./chaos.json` |
101
+
102
+ ## 🛠️ Local Development
103
+
104
+ Want to contribute to the chaos? We'd love the help!
105
+
106
+ 1. **Clone and Install**
107
+
108
+ ```bash
109
+ git clone https://github.com/anomalyco/chaosproxy.git
110
+ cd chaosproxy
111
+ npm install
112
+ ```
113
+
114
+ 2. **Build and Link**
115
+ To test your changes locally as a global command:
116
+
117
+ ```bash
118
+ npm run build
119
+ npm link
120
+ ```
121
+
122
+ 3. **Run directly**
123
+ ```bash
124
+ npx ts-node src/main.ts start -t http://localhost:8080
125
+ ```
@@ -0,0 +1,2 @@
1
+ export declare class AppModule {
2
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.AppModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const start_command_1 = require("./cli/start.command");
12
+ const logger_module_1 = require("./logger/logger.module");
13
+ const proxy_module_1 = require("./proxy/proxy.module");
14
+ const config_module_1 = require("./config/config.module");
15
+ let AppModule = class AppModule {
16
+ };
17
+ exports.AppModule = AppModule;
18
+ exports.AppModule = AppModule = __decorate([
19
+ (0, common_1.Module)({
20
+ imports: [logger_module_1.LoggerModule, proxy_module_1.ProxyModule, config_module_1.ConfigModule],
21
+ providers: [start_command_1.StartCommand],
22
+ })
23
+ ], AppModule);
24
+ //# sourceMappingURL=app.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uDAAmD;AACnD,0DAAsD;AACtD,uDAAmD;AACnD,0DAAsD;AAM/C,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAJrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,4BAAY,EAAE,0BAAW,EAAE,4BAAY,CAAC;QAClD,SAAS,EAAE,CAAC,4BAAY,CAAC;KAC1B,CAAC;GACW,SAAS,CAAG"}
@@ -0,0 +1,19 @@
1
+ import { CommandRunner } from 'nest-commander';
2
+ import { CustomLoggerService } from '../logger/logger.service';
3
+ import { ProxyService } from '../proxy/proxy.service';
4
+ import { ConfigService } from '../config/config.service';
5
+ export declare class StartCommand extends CommandRunner {
6
+ private readonly logger;
7
+ private readonly proxyService;
8
+ private readonly configService;
9
+ private configPath?;
10
+ private target?;
11
+ private port?;
12
+ private delay?;
13
+ constructor(logger: CustomLoggerService, proxyService: ProxyService, configService: ConfigService);
14
+ run(passedParams: string[], options?: any): Promise<void>;
15
+ parseConfig(path: string): void;
16
+ parseTarget(url: string): void;
17
+ parsePort(port: string): void;
18
+ parseDelay(range: string): void;
19
+ }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.StartCommand = void 0;
13
+ const nest_commander_1 = require("nest-commander");
14
+ const logger_service_1 = require("../logger/logger.service");
15
+ const proxy_service_1 = require("../proxy/proxy.service");
16
+ const config_service_1 = require("../config/config.service");
17
+ let StartCommand = class StartCommand extends nest_commander_1.CommandRunner {
18
+ logger;
19
+ proxyService;
20
+ configService;
21
+ configPath;
22
+ target;
23
+ port;
24
+ delay;
25
+ constructor(logger, proxyService, configService) {
26
+ super();
27
+ this.logger = logger;
28
+ this.proxyService = proxyService;
29
+ this.configService = configService;
30
+ }
31
+ async run(passedParams, options) {
32
+ const cliFlags = {
33
+ target: this.target,
34
+ port: this.port ? parseInt(this.port, 10) : undefined,
35
+ delay: this.delay,
36
+ };
37
+ const finalConfig = await this.configService.loadConfig(this.configPath, cliFlags);
38
+ try {
39
+ await this.proxyService.start(finalConfig);
40
+ }
41
+ catch (err) {
42
+ this.logger.error(`Failed to start proxy: ${err.message}`);
43
+ process.exit(1);
44
+ }
45
+ }
46
+ parseConfig(path) {
47
+ this.configPath = path;
48
+ }
49
+ parseTarget(url) {
50
+ this.target = url;
51
+ }
52
+ parsePort(port) {
53
+ this.port = port;
54
+ }
55
+ parseDelay(range) {
56
+ this.delay = range;
57
+ }
58
+ };
59
+ exports.StartCommand = StartCommand;
60
+ __decorate([
61
+ (0, nest_commander_1.Option)({
62
+ flags: '-c, --config <path>',
63
+ description: 'Path to the JSON configuration file',
64
+ }),
65
+ __metadata("design:type", Function),
66
+ __metadata("design:paramtypes", [String]),
67
+ __metadata("design:returntype", void 0)
68
+ ], StartCommand.prototype, "parseConfig", null);
69
+ __decorate([
70
+ (0, nest_commander_1.Option)({
71
+ flags: '-t, --target <url>',
72
+ description: 'The destination backend URL',
73
+ }),
74
+ __metadata("design:type", Function),
75
+ __metadata("design:paramtypes", [String]),
76
+ __metadata("design:returntype", void 0)
77
+ ], StartCommand.prototype, "parseTarget", null);
78
+ __decorate([
79
+ (0, nest_commander_1.Option)({
80
+ flags: '-p, --port <port>',
81
+ description: 'The local port to listen on',
82
+ }),
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", [String]),
85
+ __metadata("design:returntype", void 0)
86
+ ], StartCommand.prototype, "parsePort", null);
87
+ __decorate([
88
+ (0, nest_commander_1.Option)({
89
+ flags: '-d, --delay <range>',
90
+ description: 'Artificial latency range (e.g. 500 or 150-500)',
91
+ }),
92
+ __metadata("design:type", Function),
93
+ __metadata("design:paramtypes", [String]),
94
+ __metadata("design:returntype", void 0)
95
+ ], StartCommand.prototype, "parseDelay", null);
96
+ exports.StartCommand = StartCommand = __decorate([
97
+ (0, nest_commander_1.Command)({
98
+ name: 'start',
99
+ description: 'Start the ChaosProxy server',
100
+ }),
101
+ __metadata("design:paramtypes", [logger_service_1.CustomLoggerService,
102
+ proxy_service_1.ProxyService,
103
+ config_service_1.ConfigService])
104
+ ], StartCommand);
105
+ //# sourceMappingURL=start.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.command.js","sourceRoot":"","sources":["../../src/cli/start.command.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAgE;AAChE,6DAA+D;AAC/D,0DAAsD;AACtD,6DAAyD;AAMlD,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,8BAAa;IAO1B;IACA;IACA;IARX,UAAU,CAAU;IACpB,MAAM,CAAU;IAChB,IAAI,CAAU;IACd,KAAK,CAAU;IAEvB,YACmB,MAA2B,EAC3B,YAA0B,EAC1B,aAA4B;QAE7C,KAAK,EAAE,CAAC;QAJS,WAAM,GAAN,MAAM,CAAqB;QAC3B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,kBAAa,GAAb,aAAa,CAAe;IAG/C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,YAAsB,EAAE,OAAa;QAC7C,MAAM,QAAQ,GAAG;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;YACrD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;QAEF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CACrD,IAAI,CAAC,UAAU,EACf,QAAQ,CACT,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAMD,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAMD,WAAW,CAAC,GAAW;QACrB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,CAAC;IAMD,SAAS,CAAC,IAAY;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAMD,UAAU,CAAC,KAAa;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF,CAAA;AAjEY,oCAAY;AAsCvB;IAJC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,qCAAqC;KACnD,CAAC;;;;+CAGD;AAMD;IAJC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,6BAA6B;KAC3C,CAAC;;;;+CAGD;AAMD;IAJC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,6BAA6B;KAC3C,CAAC;;;;6CAGD;AAMD;IAJC,IAAA,uBAAM,EAAC;QACN,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,gDAAgD;KAC9D,CAAC;;;;8CAGD;uBAhEU,YAAY;IAJxB,IAAA,wBAAO,EAAC;QACP,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,6BAA6B;KAC3C,CAAC;qCAQ2B,oCAAmB;QACb,4BAAY;QACX,8BAAa;GATpC,YAAY,CAiExB"}
@@ -0,0 +1,2 @@
1
+ export declare class ConfigModule {
2
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ConfigModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const config_service_1 = require("./config.service");
12
+ const logger_module_1 = require("../logger/logger.module");
13
+ let ConfigModule = class ConfigModule {
14
+ };
15
+ exports.ConfigModule = ConfigModule;
16
+ exports.ConfigModule = ConfigModule = __decorate([
17
+ (0, common_1.Module)({
18
+ imports: [logger_module_1.LoggerModule],
19
+ providers: [config_service_1.ConfigService],
20
+ exports: [config_service_1.ConfigService],
21
+ })
22
+ ], ConfigModule);
23
+ //# sourceMappingURL=config.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../src/config/config.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,2DAAuD;AAOhD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IALxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,4BAAY,CAAC;QACvB,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ export declare const RouteConfigSchema: z.ZodObject<{
3
+ path: z.ZodString;
4
+ method: z.ZodOptional<z.ZodString>;
5
+ delay: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
6
+ failure: z.ZodOptional<z.ZodObject<{
7
+ rate: z.ZodOptional<z.ZodNumber>;
8
+ codes: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
9
+ }, z.core.$strip>>;
10
+ }, z.core.$strip>;
11
+ export declare const ChaosConfigSchema: z.ZodObject<{
12
+ server: z.ZodObject<{
13
+ port: z.ZodDefault<z.ZodNumber>;
14
+ target: z.ZodString;
15
+ }, z.core.$strip>;
16
+ global: z.ZodDefault<z.ZodObject<{
17
+ delay: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
18
+ failure: z.ZodDefault<z.ZodObject<{
19
+ rate: z.ZodDefault<z.ZodNumber>;
20
+ codes: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>>;
23
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
24
+ path: z.ZodString;
25
+ method: z.ZodOptional<z.ZodString>;
26
+ delay: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
27
+ failure: z.ZodOptional<z.ZodObject<{
28
+ rate: z.ZodOptional<z.ZodNumber>;
29
+ codes: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
30
+ }, z.core.$strip>>;
31
+ }, z.core.$strip>>>;
32
+ }, z.core.$strip>;
33
+ export type RouteConfig = z.infer<typeof RouteConfigSchema>;
34
+ export type ChaosConfig = z.infer<typeof ChaosConfigSchema>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChaosConfigSchema = exports.RouteConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.RouteConfigSchema = zod_1.z.object({
6
+ path: zod_1.z.string(),
7
+ method: zod_1.z.string().optional(),
8
+ delay: zod_1.z.union([zod_1.z.number().int().nonnegative(), zod_1.z.string()]).optional(),
9
+ failure: zod_1.z
10
+ .object({
11
+ rate: zod_1.z.number().min(0).max(1).optional(),
12
+ codes: zod_1.z.array(zod_1.z.number().int().positive()).optional(),
13
+ })
14
+ .optional(),
15
+ });
16
+ exports.ChaosConfigSchema = zod_1.z.object({
17
+ server: zod_1.z.object({
18
+ port: zod_1.z.number().int().positive().default(3000),
19
+ target: zod_1.z
20
+ .string()
21
+ .url({
22
+ message: 'Target must be a valid URL (e.g., http://localhost:8080)',
23
+ }),
24
+ }),
25
+ global: zod_1.z
26
+ .object({
27
+ delay: zod_1.z.union([zod_1.z.number().int().nonnegative(), zod_1.z.string()]).optional(),
28
+ failure: zod_1.z
29
+ .object({
30
+ rate: zod_1.z.number().min(0).max(1).default(0),
31
+ codes: zod_1.z.array(zod_1.z.number().int().positive()).default([500]),
32
+ })
33
+ .default({
34
+ rate: 0,
35
+ codes: [500],
36
+ }),
37
+ })
38
+ .default({
39
+ delay: undefined,
40
+ failure: {
41
+ rate: 0,
42
+ codes: [500],
43
+ },
44
+ }),
45
+ routes: zod_1.z.array(exports.RouteConfigSchema).optional(),
46
+ });
47
+ //# sourceMappingURL=config.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.schema.js","sourceRoot":"","sources":["../../src/config/config.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvE,OAAO,EAAE,OAAC;SACP,MAAM,CAAC;QACN,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACzC,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE;KACvD,CAAC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
1
+ import { ChaosConfig } from './config.schema';
2
+ import { CustomLoggerService } from '../logger/logger.service';
3
+ export declare class ConfigService {
4
+ private readonly logger;
5
+ constructor(logger: CustomLoggerService);
6
+ loadConfig(filePath?: string, cliFlags?: any): Promise<ChaosConfig>;
7
+ private handleValidationError;
8
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ConfigService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const fs = require("fs-extra");
15
+ const config_schema_1 = require("./config.schema");
16
+ const logger_service_1 = require("../logger/logger.service");
17
+ const chalk = require("chalk");
18
+ let ConfigService = class ConfigService {
19
+ logger;
20
+ constructor(logger) {
21
+ this.logger = logger;
22
+ }
23
+ async loadConfig(filePath, cliFlags) {
24
+ let fileConfig = {};
25
+ if (filePath) {
26
+ try {
27
+ const content = await fs.readFile(filePath, 'utf8');
28
+ fileConfig = JSON.parse(content);
29
+ }
30
+ catch (err) {
31
+ if (err.code === 'ENOENT') {
32
+ this.logger.error(`Configuration file not found at: ${filePath}`);
33
+ }
34
+ else if (err instanceof SyntaxError) {
35
+ this.logger.error(`Malformed JSON in configuration file: ${err.message}`);
36
+ }
37
+ else {
38
+ this.logger.error(`Error reading configuration file: ${err.message}`);
39
+ }
40
+ process.exit(1);
41
+ }
42
+ }
43
+ const mergedConfig = {
44
+ server: {
45
+ port: cliFlags?.port || fileConfig.server?.port,
46
+ target: cliFlags?.target || fileConfig.server?.target,
47
+ },
48
+ global: {
49
+ delay: cliFlags?.delay || fileConfig.global?.delay,
50
+ failure: cliFlags?.failure || fileConfig.global?.failure,
51
+ },
52
+ };
53
+ const result = config_schema_1.ChaosConfigSchema.safeParse(mergedConfig);
54
+ if (!result.success) {
55
+ this.handleValidationError(result.error);
56
+ process.exit(1);
57
+ }
58
+ return result.data;
59
+ }
60
+ handleValidationError(error) {
61
+ this.logger.error(chalk.bold('Configuration Validation Failed:'));
62
+ error.issues.forEach((issue) => {
63
+ const path = issue.path.join('.');
64
+ this.logger.error(`${chalk.red('✖')} ${chalk.white(path)}: ${issue.message}`);
65
+ });
66
+ console.log(`\n${chalk.gray('Tip: Ensure your .chaosrc.json follows the required schema.')}`);
67
+ }
68
+ };
69
+ exports.ConfigService = ConfigService;
70
+ exports.ConfigService = ConfigService = __decorate([
71
+ (0, common_1.Injectable)(),
72
+ __metadata("design:paramtypes", [logger_service_1.CustomLoggerService])
73
+ ], ConfigService);
74
+ //# sourceMappingURL=config.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.service.js","sourceRoot":"","sources":["../../src/config/config.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+BAA+B;AAC/B,mDAAiE;AACjE,6DAA+D;AAC/D,+BAA+B;AAGxB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IAAG,CAAC;IAE5D,KAAK,CAAC,UAAU,CAAC,QAAiB,EAAE,QAAc;QAChD,IAAI,UAAU,GAAQ,EAAE,CAAC;QAEzB,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,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,CAAC,IAAI,CAAC;IACrB,CAAC;IAEO,qBAAqB,CAAC,KAAU;QACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,CAAC;QAClE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,EAAE;YAClC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAC3D,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CACT,KAAK,KAAK,CAAC,IAAI,CAAC,6DAA6D,CAAC,EAAE,CACjF,CAAC;IACJ,CAAC;CACF,CAAA;AA3DY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE0B,oCAAmB;GAD7C,aAAa,CA2DzB"}
@@ -0,0 +1,2 @@
1
+ export declare class LoggerModule {
2
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.LoggerModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const logger_service_1 = require("./logger.service");
12
+ let LoggerModule = class LoggerModule {
13
+ };
14
+ exports.LoggerModule = LoggerModule;
15
+ exports.LoggerModule = LoggerModule = __decorate([
16
+ (0, common_1.Module)({
17
+ providers: [logger_service_1.CustomLoggerService],
18
+ exports: [logger_service_1.CustomLoggerService],
19
+ })
20
+ ], LoggerModule);
21
+ //# sourceMappingURL=logger.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../src/logger/logger.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAuD;AAMhD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAJxB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,oCAAmB,CAAC;QAChC,OAAO,EAAE,CAAC,oCAAmB,CAAC;KAC/B,CAAC;GACW,YAAY,CAAG"}
@@ -0,0 +1,15 @@
1
+ import { LoggerService } from '@nestjs/common';
2
+ export declare class CustomLoggerService implements LoggerService {
3
+ private readonly methodColors;
4
+ private getTimestamp;
5
+ private formatMethod;
6
+ log(message: any, context?: string): void;
7
+ error(message: any, stack?: string, context?: string): void;
8
+ warn(message: any, context?: string): void;
9
+ debug(message: any, context?: string): void;
10
+ verbose(message: any, context?: string): void;
11
+ logPass(method: string, path: string, latency: number): void;
12
+ logDelay(method: string, path: string, addedLatency: number, totalLatency: number): void;
13
+ logChaos(method: string, path: string, statusCode: number): void;
14
+ logDrop(method: string, path: string): void;
15
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CustomLoggerService = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const chalk = require("chalk");
12
+ let CustomLoggerService = class CustomLoggerService {
13
+ methodColors = {
14
+ GET: chalk.blue,
15
+ POST: chalk.green,
16
+ PUT: chalk.yellow,
17
+ DELETE: chalk.red,
18
+ PATCH: chalk.magenta,
19
+ };
20
+ getTimestamp() {
21
+ return chalk.gray(new Date().toLocaleTimeString('en-GB', { hour12: false }) +
22
+ '.' +
23
+ String(new Date().getMilliseconds()).padStart(3, '0'));
24
+ }
25
+ formatMethod(method) {
26
+ const colorizer = this.methodColors[method.toUpperCase()] || chalk.white;
27
+ return colorizer(method.toUpperCase().padEnd(5));
28
+ }
29
+ log(message, context) {
30
+ console.log(`${this.getTimestamp()} ${chalk.white('[LOG]')} ${context ? chalk.cyan(context) + ' ' : ''}${message}`);
31
+ }
32
+ error(message, stack, context) {
33
+ console.error(`${this.getTimestamp()} ${chalk.red('[ERR]')} ${context ? chalk.cyan(context) + ' ' : ''}${message}`);
34
+ if (stack)
35
+ console.error(chalk.red(stack));
36
+ }
37
+ warn(message, context) {
38
+ console.warn(`${this.getTimestamp()} ${chalk.yellow('[WRN]')} ${context ? chalk.cyan(context) + ' ' : ''}${message}`);
39
+ }
40
+ debug(message, context) {
41
+ console.log(`${this.getTimestamp()} ${chalk.magenta('[DBG]')} ${context ? chalk.cyan(context) + ' ' : ''}${message}`);
42
+ }
43
+ verbose(message, context) {
44
+ console.log(`${this.getTimestamp()} ${chalk.gray('[VRB]')} ${context ? chalk.cyan(context) + ' ' : ''}${message}`);
45
+ }
46
+ logPass(method, path, latency) {
47
+ const tag = chalk.green('🟢 [PASS] ');
48
+ console.log(`${this.getTimestamp()} ${tag} ${this.formatMethod(method)} ${path} ${chalk.gray(`(Proxied in ${latency}ms)`)}`);
49
+ }
50
+ logDelay(method, path, addedLatency, totalLatency) {
51
+ const tag = chalk.yellow('🟡 [DELAY]');
52
+ console.log(`${this.getTimestamp()} ${tag} ${this.formatMethod(method)} ${path} ${chalk.yellow(`(Added ${addedLatency}ms, Total: ${totalLatency}ms)`)}`);
53
+ }
54
+ logChaos(method, path, statusCode) {
55
+ const tag = chalk.red('🔴 [CHAOS]');
56
+ console.log(`${this.getTimestamp()} ${tag} ${this.formatMethod(method)} ${path} ${chalk.red(`(Intercepted: Swapped to ${statusCode})`)}`);
57
+ }
58
+ logDrop(method, path) {
59
+ const tag = chalk.bold.red('❌ [DROP] ');
60
+ console.log(`${this.getTimestamp()} ${tag} ${this.formatMethod(method)} ${path} ${chalk.bold.red('(Connection Dropped)')}`);
61
+ }
62
+ };
63
+ exports.CustomLoggerService = CustomLoggerService;
64
+ exports.CustomLoggerService = CustomLoggerService = __decorate([
65
+ (0, common_1.Injectable)()
66
+ ], CustomLoggerService);
67
+ //# sourceMappingURL=logger.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.service.js","sourceRoot":"","sources":["../../src/logger/logger.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2D;AAC3D,+BAA+B;AAGxB,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACb,YAAY,GAA6C;QACxE,GAAG,EAAE,KAAK,CAAC,IAAI;QACf,IAAI,EAAE,KAAK,CAAC,KAAK;QACjB,GAAG,EAAE,KAAK,CAAC,MAAM;QACjB,MAAM,EAAE,KAAK,CAAC,GAAG;QACjB,KAAK,EAAE,KAAK,CAAC,OAAO;KACrB,CAAC;IAEM,YAAY;QAClB,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,IAAI,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YACvD,GAAG;YACH,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CACxD,CAA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