@patchstack/connect 0.3.15 → 0.3.16

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.
@@ -30,7 +30,7 @@ let _protection: Awaited<ReturnType<typeof createProtection>> | undefined;
30
30
  async function getProtection() {
31
31
  if (!_protection) {
32
32
  // Always-on: block by default. An explicit PATCHSTACK_MODE=dry-run downgrades to log-only.
33
- const mode = process.env.PATCHSTACK_MODE === "dry-run" ? "dry-run" : "block";
33
+ const mode: "block" | "dry-run" = process.env.PATCHSTACK_MODE === "dry-run" ? "dry-run" : "block";
34
34
  const token = process.env.PATCHSTACK_WAF_TOKEN;
35
35
  const siteUuid = PS_SITE_UUID.startsWith("__") ? process.env.PATCHSTACK_SITE_UUID : PS_SITE_UUID;
36
36
  // Egress SSRF screening: block the app's outbound calls to internal / metadata addresses,
@@ -80,11 +80,11 @@ export async function inspectServerFn(data: unknown): Promise<{ rule?: string; m
80
80
  // src/start.ts (the browser→Supabase tunnel screens its own forwarded response). Only acts on a
81
81
  // web Response (text/JSON/HTML) — anything else, or any error, passes through untouched (fail-open,
82
82
  // never breaks a response).
83
- export async function screenResponse(response: unknown): Promise<unknown> {
83
+ export async function screenResponse<T>(response: T): Promise<T> {
84
84
  try {
85
85
  if (!(response instanceof Response)) return response;
86
86
  const protection = await getProtection();
87
- return protection.screenResponse ? await protection.screenResponse(response) : response;
87
+ return (protection.screenResponse ? await protection.screenResponse(response) : response) as T;
88
88
  } catch {
89
89
  return response; // fail open
90
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patchstack/connect",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "Patchstack connector for JavaScript applications. Scans your lockfile and reports installed packages to Patchstack for vulnerability monitoring.",
5
5
  "keywords": [
6
6
  "patchstack",