@patchstack/connect 0.5.12 → 0.5.15
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 +24 -22
- package/README.md +19 -19
- package/dist/cli.js +637 -484
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +16 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/protect.cjs +748 -168
- package/dist/protect.cjs.map +1 -1
- package/dist/protect.d.cts +25 -1
- package/dist/protect.d.ts +25 -1
- package/dist/protect.edge.js +732 -159
- package/dist/protect.edge.js.map +2 -2
- package/dist/protect.js +733 -160
- package/dist/protect.js.map +1 -1
- package/dist/{refresh-manifest-47HJRCDX.js → refresh-manifest-DZQOEO3Q.js} +17 -10
- package/dist/refresh-manifest-DZQOEO3Q.js.map +1 -0
- package/package.json +1 -1
- package/dist/refresh-manifest-47HJRCDX.js.map +0 -1
package/dist/protect.d.cts
CHANGED
|
@@ -69,6 +69,19 @@ export interface Protection {
|
|
|
69
69
|
stop: () => Promise<void>;
|
|
70
70
|
/** Alias of `stop`, under the name callers already have. */
|
|
71
71
|
stopRefresh: () => Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Where the rules in force came from, and whether the most recent resolution was clean — the same
|
|
74
|
+
* shape `refresh()` resolves with, kept current by boot, every refresh, and recovery.
|
|
75
|
+
*
|
|
76
|
+
* With a live source, `ok: false` means the guard is not running the rules the source would give it
|
|
77
|
+
* now: `origin` says what it is running instead. When no `refreshMs` loop is configured and the first
|
|
78
|
+
* resolution was not clean, the guard retries on a lengthening schedule until one is.
|
|
79
|
+
*/
|
|
80
|
+
readonly ruleSource: {
|
|
81
|
+
ok: boolean;
|
|
82
|
+
origin: "api" | "cache" | "bundled" | "empty";
|
|
83
|
+
reason?: string;
|
|
84
|
+
};
|
|
72
85
|
/** Whether this guard reports security events, and if not, why not.
|
|
73
86
|
*
|
|
74
87
|
* Reporting is on for a site enrolled in Patchstack-managed mitigation that is running managed rules
|
|
@@ -244,7 +257,13 @@ export interface CreateProtectionOptions {
|
|
|
244
257
|
reportManifest?: boolean;
|
|
245
258
|
/** Directory the manifest re-scan reads the lockfile from during a refresh. Default process.cwd(). */
|
|
246
259
|
cwd?: string;
|
|
247
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* Directory for the last-known-good rule cache (disk — the default cache backend).
|
|
262
|
+
*
|
|
263
|
+
* A cache belongs to the source it was fetched for: the site UUID or token, and the rules endpoint.
|
|
264
|
+
* One written for any other source — or by a version that did not record its source — reads as
|
|
265
|
+
* empty, so it is never enforced, revalidated or used to attribute detections for this guard.
|
|
266
|
+
*/
|
|
248
267
|
cacheDir?: string;
|
|
249
268
|
/**
|
|
250
269
|
* Pluggable last-known-good cache, for runtimes without a filesystem (Workers/Deno). Overrides
|
|
@@ -329,6 +348,11 @@ export interface CreateProtectionOptions {
|
|
|
329
348
|
screenDns?: boolean;
|
|
330
349
|
/** Redaction mask (string or per-category function). Default "[REDACTED]". */
|
|
331
350
|
maskWith?: string | ((category?: string) => string);
|
|
351
|
+
/**
|
|
352
|
+
* Operational problems the guard handled without failing a request. Without it, rules that are not
|
|
353
|
+
* current — a failed fetch, a rejected update, held build-scoped rules — are written to the console
|
|
354
|
+
* once per cause instead.
|
|
355
|
+
*/
|
|
332
356
|
onError?: (err: unknown) => void;
|
|
333
357
|
onEgressBlock?: (info: { url: string; host: string | null; method: string }) => void;
|
|
334
358
|
onDetect?: (detection: {
|
package/dist/protect.d.ts
CHANGED
|
@@ -69,6 +69,19 @@ export interface Protection {
|
|
|
69
69
|
stop: () => Promise<void>;
|
|
70
70
|
/** Alias of `stop`, under the name callers already have. */
|
|
71
71
|
stopRefresh: () => Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Where the rules in force came from, and whether the most recent resolution was clean — the same
|
|
74
|
+
* shape `refresh()` resolves with, kept current by boot, every refresh, and recovery.
|
|
75
|
+
*
|
|
76
|
+
* With a live source, `ok: false` means the guard is not running the rules the source would give it
|
|
77
|
+
* now: `origin` says what it is running instead. When no `refreshMs` loop is configured and the first
|
|
78
|
+
* resolution was not clean, the guard retries on a lengthening schedule until one is.
|
|
79
|
+
*/
|
|
80
|
+
readonly ruleSource: {
|
|
81
|
+
ok: boolean;
|
|
82
|
+
origin: "api" | "cache" | "bundled" | "empty";
|
|
83
|
+
reason?: string;
|
|
84
|
+
};
|
|
72
85
|
/** Whether this guard reports security events, and if not, why not.
|
|
73
86
|
*
|
|
74
87
|
* Reporting is on for a site enrolled in Patchstack-managed mitigation that is running managed rules
|
|
@@ -244,7 +257,13 @@ export interface CreateProtectionOptions {
|
|
|
244
257
|
reportManifest?: boolean;
|
|
245
258
|
/** Directory the manifest re-scan reads the lockfile from during a refresh. Default process.cwd(). */
|
|
246
259
|
cwd?: string;
|
|
247
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* Directory for the last-known-good rule cache (disk — the default cache backend).
|
|
262
|
+
*
|
|
263
|
+
* A cache belongs to the source it was fetched for: the site UUID or token, and the rules endpoint.
|
|
264
|
+
* One written for any other source — or by a version that did not record its source — reads as
|
|
265
|
+
* empty, so it is never enforced, revalidated or used to attribute detections for this guard.
|
|
266
|
+
*/
|
|
248
267
|
cacheDir?: string;
|
|
249
268
|
/**
|
|
250
269
|
* Pluggable last-known-good cache, for runtimes without a filesystem (Workers/Deno). Overrides
|
|
@@ -329,6 +348,11 @@ export interface CreateProtectionOptions {
|
|
|
329
348
|
screenDns?: boolean;
|
|
330
349
|
/** Redaction mask (string or per-category function). Default "[REDACTED]". */
|
|
331
350
|
maskWith?: string | ((category?: string) => string);
|
|
351
|
+
/**
|
|
352
|
+
* Operational problems the guard handled without failing a request. Without it, rules that are not
|
|
353
|
+
* current — a failed fetch, a rejected update, held build-scoped rules — are written to the console
|
|
354
|
+
* once per cause instead.
|
|
355
|
+
*/
|
|
332
356
|
onError?: (err: unknown) => void;
|
|
333
357
|
onEgressBlock?: (info: { url: string; host: string | null; method: string }) => void;
|
|
334
358
|
onDetect?: (detection: {
|