@testsmith/api-spector-agent 0.4.7

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 (3) hide show
  1. package/README.md +58 -0
  2. package/dist/index.cjs +47560 -0
  3. package/package.json +35 -0
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @testsmith/api-spector-agent
2
+
3
+ The **API Spector private runner**. It monitors your local and internal APIs -
4
+ things API Spector Cloud can never reach (`localhost`, `10.x`, staging behind a
5
+ VPN, a service mesh) - **without opening a single inbound port**.
6
+
7
+ It runs inside your own network, polls API Spector Cloud over HTTPS, runs each
8
+ due check with the real api-spector engine (the same one the desktop app and CLI
9
+ use: setup chains, pre/post scripts, assertions, faker data), and posts the
10
+ result back. All traffic is **outbound** - the cloud never connects to you.
11
+
12
+ ## Run it
13
+
14
+ ```bash
15
+ APP_URL=https://your-cloud-host \
16
+ AGENT_TOKEN=<your token> \
17
+ npx @testsmith/api-spector-agent
18
+ ```
19
+
20
+ Generate the token under **Private runner** in the cloud (owner menu). Then tick
21
+ **Run on my private runner** on any monitor and it runs here instead of on the
22
+ cloud runner.
23
+
24
+ Prefer a container? The same runner ships as a Docker image:
25
+
26
+ ```bash
27
+ docker run -d --name api-spector-agent --restart unless-stopped \
28
+ -e APP_URL=https://your-cloud-host \
29
+ -e AGENT_TOKEN=<your token> \
30
+ testsmith/api-spector-agent:latest
31
+ ```
32
+
33
+ ## Keep it running
34
+
35
+ `npx` is ideal for a CI step or a quick check. For an always-on host, install it
36
+ and supervise it with your process manager:
37
+
38
+ ```bash
39
+ npm i -g @testsmith/api-spector-agent
40
+ # then run `api-spector-agent` under systemd / pm2 with the env vars set
41
+ ```
42
+
43
+ ## Environment
44
+
45
+ | Variable | Required | Default | Meaning |
46
+ |---|---|---|---|
47
+ | `APP_URL` | yes | - | Base URL of your API Spector Cloud |
48
+ | `AGENT_TOKEN` | yes | - | Org API token with the `agent` ability |
49
+ | `POLL_INTERVAL_MS` | no | `5000` | Poll cadence in milliseconds |
50
+
51
+ ## Security
52
+
53
+ - **Outbound only.** No inbound port, tunnel, or firewall rule.
54
+ - **Scoped token.** The `agent` ability can only read your org's due feed and
55
+ post its results - nothing else. Revoke it any time to stop the agent.
56
+ - **Node 18+.** No install-time dependencies; the engine is bundled in.
57
+
58
+ See the full guide: **Private runner** in the API Spector Cloud docs.