@appwarden/middleware 3.11.2 → 3.11.4

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/index.js CHANGED
@@ -4,22 +4,22 @@ import {
4
4
  isValidCacheUrl
5
5
  } from "./chunk-QEFORWCW.js";
6
6
  import {
7
- useContentSecurityPolicy
8
- } from "./chunk-RQLMO5FA.js";
7
+ UseAppwardenInputSchema
8
+ } from "./chunk-5HCAAVK5.js";
9
9
  import {
10
10
  APPWARDEN_CACHE_KEY,
11
11
  CSPDirectivesSchema,
12
12
  CSPModeSchema,
13
13
  LOCKDOWN_TEST_EXPIRY_MS
14
- } from "./chunk-2WPLLVUI.js";
15
- import "./chunk-ASH6UZ27.js";
14
+ } from "./chunk-ZTVJBORU.js";
15
+ import "./chunk-WEM7GS4M.js";
16
16
  export {
17
17
  APPWARDEN_CACHE_KEY,
18
18
  CSPDirectivesSchema,
19
19
  CSPModeSchema,
20
20
  LOCKDOWN_TEST_EXPIRY_MS,
21
+ UseAppwardenInputSchema,
21
22
  getEdgeConfigId,
22
23
  isCacheUrl,
23
- isValidCacheUrl,
24
- useContentSecurityPolicy
24
+ isValidCacheUrl
25
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appwarden/middleware",
3
- "version": "3.11.2",
3
+ "version": "3.11.4",
4
4
  "description": "Instantly disable all user interaction with your app deployed on Cloudflare or Vercel",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -100,7 +100,6 @@
100
100
  "cookie@<0.7.0": ">=0.7.0",
101
101
  "esbuild@<=0.24.2": ">=0.25.0",
102
102
  "path-to-regexp@>=4.0.0 <6.3.0": ">=6.3.0",
103
- "tar@<7.5.7": ">=7.5.7",
104
103
  "undici@<6.23.0": ">=6.23.0",
105
104
  "body-parser@>=2.2.0 <2.2.1": ">=2.2.1",
106
105
  "jws@=4.0.0": ">=4.0.1",
@@ -111,7 +110,6 @@
111
110
  "qs@>=6.7.0 <=6.14.1": ">=6.14.2",
112
111
  "devalue@<=5.6.2": ">=5.6.3",
113
112
  "minimatch@<10.2.1": ">=10.2.3",
114
- "tar@<7.5.8": ">=7.5.8",
115
113
  "ajv@>=7.0.0-alpha.0 <8.18.0": ">=8.18.0",
116
114
  "rollup@>=4.0.0 <4.59.0": ">=4.59.0",
117
115
  "h3@<=1.15.4": ">=1.15.5",
@@ -120,7 +118,7 @@
120
118
  "serialize-javascript@<=7.0.2": ">=7.0.3",
121
119
  "svgo@=4.0.0": ">=4.0.1",
122
120
  "@opennextjs/cloudflare@<1.17.1": ">=1.17.1",
123
- "tar@<=7.5.9": ">=7.5.10"
121
+ "tar@<=7.5.10": ">=7.5.11"
124
122
  }
125
123
  }
126
124
  }
@@ -121,6 +121,15 @@ declare global {
121
121
  interface Env extends Bindings {
122
122
  }
123
123
  }
124
+ /**
125
+ * Cloudflare request context shape used by withAppwarden config functions.
126
+ * This matches the context passed to config functions in appwardenOnCloudflare.
127
+ */
128
+ type RequestContext = {
129
+ env: Bindings;
130
+ ctx: ExecutionContext;
131
+ cf: unknown;
132
+ };
124
133
 
125
134
  interface MiddlewareContext {
126
135
  hostname: string;
@@ -471,6 +480,4 @@ declare const UseCSPInputSchema: z.ZodObject<{
471
480
  }>;
472
481
  type UseCSPInput = z.infer<typeof UseCSPInputSchema>;
473
482
 
474
- declare const useContentSecurityPolicy: (input: UseCSPInput) => Middleware;
475
-
476
- export { type Bindings as B, CSPDirectivesSchema as C, type Middleware as M, CSPModeSchema as a, useContentSecurityPolicy as u };
483
+ export { type Bindings as B, CSPDirectivesSchema as C, type Middleware as M, type RequestContext as R, type UseCSPInput as U, CSPModeSchema as a };
package/vercel.js CHANGED
@@ -7,23 +7,25 @@ import {
7
7
  TEMPORARY_REDIRECT_STATUS,
8
8
  buildLockPageUrl,
9
9
  debug,
10
+ isHTMLRequest,
10
11
  isOnLockPage
11
- } from "./chunk-6JYUNSUJ.js";
12
+ } from "./chunk-AY4ZKZTF.js";
12
13
  import {
13
14
  APPWARDEN_CACHE_KEY,
14
15
  CSPDirectivesSchema,
15
16
  CSPModeSchema,
16
17
  errors,
17
- globalErrors,
18
- isHTMLRequest
19
- } from "./chunk-2WPLLVUI.js";
18
+ globalErrors
19
+ } from "./chunk-ZTVJBORU.js";
20
20
  import {
21
- AppwardenApiHostnameSchema,
22
- LockValue,
23
21
  getErrors,
24
22
  makeCSPHeader,
25
23
  printMessage
26
- } from "./chunk-ASH6UZ27.js";
24
+ } from "./chunk-R7TXTHSG.js";
25
+ import {
26
+ AppwardenApiHostnameSchema,
27
+ LockValue
28
+ } from "./chunk-WEM7GS4M.js";
27
29
 
28
30
  // src/runners/appwarden-on-vercel.ts
29
31
  import { waitUntil } from "@vercel/functions";