@patchstack/connect 0.3.22 → 0.3.24
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/AGENT-INSTALL.md +16 -7
- package/README.md +22 -2
- package/dist/chunk-MJOTFUDE.js +87 -0
- package/dist/chunk-MJOTFUDE.js.map +1 -0
- package/dist/cli.js +2868 -129
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +105 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -2
- package/dist/index.d.ts +37 -2
- package/dist/index.js +103 -1
- package/dist/index.js.map +1 -1
- package/dist/protect.cjs +1182 -217
- package/dist/protect.cjs.map +1 -1
- package/dist/protect.d.ts +27 -1
- package/dist/protect.edge.js +3530 -0
- package/dist/protect.edge.js.map +7 -0
- package/dist/protect.js +1066 -193
- package/dist/protect.js.map +1 -1
- package/dist/{refresh-manifest-OW7WT5A6.js → refresh-manifest-MUWVIPFR.js} +12 -2
- package/dist/refresh-manifest-MUWVIPFR.js.map +1 -0
- package/package.json +11 -3
- package/dist/refresh-manifest-OW7WT5A6.js.map +0 -1
package/dist/protect.d.ts
CHANGED
|
@@ -48,8 +48,30 @@ export interface CreateProtectionOptions {
|
|
|
48
48
|
baseUrl?: string;
|
|
49
49
|
/** Pulse site UUID — pull live per-site rules from the Pulse rules API (cached). */
|
|
50
50
|
siteUuid?: string;
|
|
51
|
+
/**
|
|
52
|
+
* WP-format site API key (`{secret}-{oauth.id}`) for authenticated block logs
|
|
53
|
+
* via connector `POST /api/logs/log`. Falls back to `PATCHSTACK_API_KEY`, then
|
|
54
|
+
* `.patchstackrc.json` `apiKey`. Never put this in the public widget.
|
|
55
|
+
*/
|
|
56
|
+
apiKey?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Credential for the authenticated rules lookup. Falls back to `apiKey`, then
|
|
59
|
+
* `PATCHSTACK_PULSE_AUTH`, then `.patchstackrc.json` `pulseAuth`. Exchanged
|
|
60
|
+
* for a short-lived token; never sent directly. Never put this in the public
|
|
61
|
+
* widget.
|
|
62
|
+
*/
|
|
63
|
+
pulseAuth?: string;
|
|
51
64
|
/** Override the Pulse rules API base URL. */
|
|
52
65
|
pulseRulesUrl?: string;
|
|
66
|
+
/**
|
|
67
|
+
* When false, skip posting block events to connector `/api/logs/log`.
|
|
68
|
+
* Also disabled when `PATCHSTACK_TELEMETRY=off` or when no apiKey is available.
|
|
69
|
+
*/
|
|
70
|
+
reportFirewallLog?: boolean;
|
|
71
|
+
/** Optional Source-Host header for connector hostname checks. */
|
|
72
|
+
sourceHost?: string;
|
|
73
|
+
/** Optional fetch override (tests). */
|
|
74
|
+
fetchImpl?: typeof fetch;
|
|
53
75
|
/**
|
|
54
76
|
* Re-fetch and hot-swap the live rules every N ms. For long-lived runtimes that aren't restarted
|
|
55
77
|
* on change (an AI builder's sandbox/preview) so a rule that becomes relevant after boot still
|
|
@@ -104,8 +126,12 @@ export interface CreateProtectionOptions {
|
|
|
104
126
|
phase?: Phase;
|
|
105
127
|
mode: string;
|
|
106
128
|
category?: string;
|
|
107
|
-
rule?: { id?: string; category?: string };
|
|
129
|
+
rule?: { id?: string | number; category?: string };
|
|
108
130
|
message?: string;
|
|
131
|
+
method?: string | null;
|
|
132
|
+
path?: string | null;
|
|
133
|
+
ip?: string | null;
|
|
134
|
+
userAgent?: string | null;
|
|
109
135
|
}) => void;
|
|
110
136
|
}
|
|
111
137
|
|