@patchstack/connect 0.5.26 → 0.5.30
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 +34 -19
- package/README.md +73 -17
- package/dist/{chunk-YG5C7HYB.js → chunk-52IV7LN7.js} +1 -1
- package/dist/{chunk-YG5C7HYB.js.map → chunk-52IV7LN7.js.map} +1 -1
- package/dist/cli.js +2755 -371
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +33 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +33 -12
- package/dist/index.js.map +1 -1
- package/dist/protect/templates/astro-middleware.ts +5 -4
- package/dist/protect/templates/express-guard.cjs +5 -8
- package/dist/protect/templates/express-guard.js +5 -8
- package/dist/protect/templates/express-guard.ts +5 -8
- package/dist/protect/templates/fastify-plugin.cjs +52 -6
- package/dist/protect/templates/fastify-plugin.js +52 -6
- package/dist/protect/templates/fastify-plugin.ts +53 -7
- package/dist/protect/templates/fetch-guard.ts +52 -0
- package/dist/protect/templates/generic-guard.cjs +6 -5
- package/dist/protect/templates/generic-guard.js +6 -5
- package/dist/protect/templates/generic-guard.ts +5 -8
- package/dist/protect/templates/guard.ts +4 -7
- package/dist/protect/templates/next-guard.ts +5 -4
- package/dist/protect/templates/next-middleware.ts +5 -4
- package/dist/protect/templates/nuxt-middleware.ts +5 -4
- package/dist/protect/templates/sveltekit-hooks.ts +5 -4
- package/dist/protect.cjs +33 -12
- package/dist/protect.cjs.map +1 -1
- package/dist/protect.d.cts +1 -1
- package/dist/protect.d.ts +1 -1
- package/dist/protect.edge.js +2 -2
- package/dist/protect.edge.js.map +1 -1
- package/dist/protect.js +4 -4
- package/dist/protect.js.map +1 -1
- package/dist/{refresh-manifest-OMRDCNFD.js → refresh-manifest-EBORKM75.js} +33 -12
- package/dist/refresh-manifest-EBORKM75.js.map +1 -0
- package/package.json +5 -2
- package/dist/refresh-manifest-OMRDCNFD.js.map +0 -1
package/dist/protect.d.cts
CHANGED
|
@@ -19,7 +19,7 @@ export interface Protection {
|
|
|
19
19
|
* Any further arguments are the host's handler arguments, passed on to `peerAddress`. */
|
|
20
20
|
fetchGuard(): (request: Request, ...hostArgs: unknown[]) => Promise<Response | null>;
|
|
21
21
|
/** Screens the request, then the response (secret-leak redaction / withhold). */
|
|
22
|
-
fetch(handler: (request: Request, ...rest:
|
|
22
|
+
fetch<This, Args extends unknown[]>(handler: (this: This, request: Request, ...rest: Args) => Response | Promise<Response>): (this: This, request: Request, ...rest: Args) => Promise<Response>;
|
|
23
23
|
/**
|
|
24
24
|
* Screen a fetch Response through the response-phase rules (redact/withhold/encode).
|
|
25
25
|
*
|
package/dist/protect.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface Protection {
|
|
|
19
19
|
* Any further arguments are the host's handler arguments, passed on to `peerAddress`. */
|
|
20
20
|
fetchGuard(): (request: Request, ...hostArgs: unknown[]) => Promise<Response | null>;
|
|
21
21
|
/** Screens the request, then the response (secret-leak redaction / withhold). */
|
|
22
|
-
fetch(handler: (request: Request, ...rest:
|
|
22
|
+
fetch<This, Args extends unknown[]>(handler: (this: This, request: Request, ...rest: Args) => Response | Promise<Response>): (this: This, request: Request, ...rest: Args) => Promise<Response>;
|
|
23
23
|
/**
|
|
24
24
|
* Screen a fetch Response through the response-phase rules (redact/withhold/encode).
|
|
25
25
|
*
|
package/dist/protect.edge.js
CHANGED
|
@@ -7261,10 +7261,10 @@ async function createProtection(options = {}) {
|
|
|
7261
7261
|
},
|
|
7262
7262
|
// Wrap a fetch handler: screens the request, then the response (redact/block).
|
|
7263
7263
|
fetch(handler) {
|
|
7264
|
-
return async (request, ...rest)
|
|
7264
|
+
return async function(request, ...rest) {
|
|
7265
7265
|
const { blocked, client } = await screenFetchRequest(request, rest);
|
|
7266
7266
|
if (blocked) return blocked;
|
|
7267
|
-
const response = await handler(request, ...rest);
|
|
7267
|
+
const response = await handler.call(this, request, ...rest);
|
|
7268
7268
|
return screenResp(response, reqContextFromFetch(request, client));
|
|
7269
7269
|
};
|
|
7270
7270
|
},
|