sla-wizard-plugin-custom-baseurl 1.0.0 → 1.0.2

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
@@ -4,7 +4,7 @@ A plugin for [SLA Wizard](../sla-wizard) and [sla-wizard-nginx-confd](../sla-wiz
4
4
 
5
5
  When a path declares `x-nginx-server-baseurl`, nginx will proxy that endpoint to the **custom backend URL** instead of the global `servers[0].url`. Endpoints without the extension continue to use the global default.
6
6
 
7
- ```
7
+ ```text
8
8
  Client → nginx: POST /models/chatgpt/v1/chat/completions
9
9
  nginx → backend: POST http://localhost:8001/v1/chat/completions ← custom URL
10
10
 
@@ -120,7 +120,7 @@ node my-cli.js config-nginx-baseurl \
120
120
 
121
121
  Output:
122
122
 
123
- ```
123
+ ```text
124
124
  nginx-output/
125
125
  ├── nginx.conf ← server block + URI routing rules
126
126
  └── conf.d/
@@ -147,7 +147,7 @@ node my-cli.js add-to-baseurl-confd \
147
147
  ### CLI options
148
148
 
149
149
  | Option | Description | Default |
150
- |---|---|---|
150
+ | --- | --- | --- |
151
151
  | `-o, --outDir <dir>` | Output directory | **required** |
152
152
  | `--oas <path>` | Path to OAS v3 file | `./specs/oas.yaml` |
153
153
  | `--sla <path>` | Single SLA file, directory of SLAs, or URL | `./specs/sla.yaml` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sla-wizard-plugin-custom-baseurl",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Plugin that overrides the nginx proxy_pass target per endpoint using the x-nginx-server-baseurl OAS extension",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "js-yaml": "^4.1.0",
11
- "sla-wizard-plugin-nginx-strip": "^1.0.0"
11
+ "sla-wizard-plugin-nginx-strip": "^1.0.2"
12
12
  },
13
13
  "devDependencies": {
14
14
  "chai": "^4.3.6",
package/tests/tests.js CHANGED
@@ -622,9 +622,9 @@ describe("sla-wizard-plugin-custom-baseUrl Test Suite", function () {
622
622
 
623
623
  it("nginx.conf does not contain any rate-limiting location blocks (those are in conf.d)", function () {
624
624
  const content = fs.readFileSync(path.join(outDir, "nginx.conf"), "utf8");
625
- // Rate-limited location names contain the context_id pattern
626
- expect(content).to.not.include("sla-dgalvan_us_es");
627
- expect(content).to.not.include("sla-japarejo_us_es");
625
+ // Rate-limited location BLOCKS move to conf.d — nginx.conf must not have them
626
+ expect(content).to.not.match(/location\s+\/sla-dgalvan/);
627
+ expect(content).to.not.match(/location\s+\/sla-japarejo/);
628
628
  });
629
629
 
630
630
  // ── idempotency ──────────────────────────────────────────────────────────