@appwarden/middleware 3.2.1 → 3.4.0

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,14 +4,15 @@ import {
4
4
  isValidCacheUrl
5
5
  } from "./chunk-QEFORWCW.js";
6
6
  import {
7
- CSPDirectivesSchema,
8
- CSPModeSchema,
9
7
  useContentSecurityPolicy
10
- } from "./chunk-A5XGYLYS.js";
8
+ } from "./chunk-YBWFEBZC.js";
11
9
  import {
12
10
  APPWARDEN_CACHE_KEY,
11
+ CSPDirectivesSchema,
12
+ CSPModeSchema,
13
13
  LOCKDOWN_TEST_EXPIRY_MS
14
- } from "./chunk-L5EQIJZB.js";
14
+ } from "./chunk-HCGLR3Z3.js";
15
+ import "./chunk-G4RRFNHY.js";
15
16
  export {
16
17
  APPWARDEN_CACHE_KEY,
17
18
  CSPDirectivesSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appwarden/middleware",
3
- "version": "3.2.1",
3
+ "version": "3.4.0",
4
4
  "description": "Instantly shut off access your app deployed on Cloudflare or Vercel",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@astrojs/cloudflare": ">=11.0.0",
67
- "@opennextjs/cloudflare": ">=1.0.0",
67
+ "@opennextjs/cloudflare": ">=1.16.6",
68
68
  "@vercel/functions": ">=1.0.0",
69
69
  "astro": ">=4.0.0",
70
70
  "next": ">=14"
@@ -103,7 +103,12 @@
103
103
  "@smithy/config-resolver@<4.4.0": ">=4.4.0",
104
104
  "@isaacs/brace-expansion@<=5.0.0": ">=5.0.1",
105
105
  "npm@<=11.8.0": ">=11.9.0",
106
- "wrangler@>=4.0.0 <4.59.1": ">=4.59.1"
106
+ "wrangler@>=4.0.0 <4.59.1": ">=4.59.1",
107
+ "qs@>=6.7.0 <=6.14.1": ">=6.14.2",
108
+ "devalue@<=5.6.2": ">=5.6.3",
109
+ "minimatch@<10.2.1": ">=10.2.1",
110
+ "tar@<7.5.8": ">=7.5.8",
111
+ "ajv@>=7.0.0-alpha.0 <8.18.0": ">=8.18.0"
107
112
  }
108
113
  }
109
114
  }
@@ -97,16 +97,6 @@ declare global {
97
97
  }
98
98
  }
99
99
 
100
- interface MiddlewareContext {
101
- hostname: string;
102
- request: Request;
103
- response: Response;
104
- waitUntil: ExecutionContext["waitUntil"];
105
- }
106
- type Middleware = (context: MiddlewareContext, next: () => MiddlewareNextSchemaType) => MiddlewareNextSchemaType;
107
- declare const MiddlewareNextSchema: z.ZodUnion<[z.ZodVoid, z.ZodNull, z.ZodPromise<z.ZodUnion<[z.ZodVoid, z.ZodNull]>>]>;
108
- type MiddlewareNextSchemaType = z.infer<typeof MiddlewareNextSchema>;
109
-
110
100
  declare const CSPDirectivesSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
111
101
  "default-src": z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString, z.ZodBoolean]>>;
112
102
  "script-src": z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString, z.ZodBoolean]>>;
@@ -191,7 +181,6 @@ declare const CSPDirectivesSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
191
181
  }>]>;
192
182
  declare const CSPModeSchema: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"disabled">, z.ZodLiteral<"report-only">, z.ZodLiteral<"enforced">]>>>;
193
183
  declare const UseCSPInputSchema: z.ZodEffects<z.ZodObject<{
194
- hostname: z.ZodOptional<z.ZodString>;
195
184
  mode: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"disabled">, z.ZodLiteral<"report-only">, z.ZodLiteral<"enforced">]>>>;
196
185
  directives: z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
197
186
  "default-src": z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString, z.ZodBoolean]>>;
@@ -413,7 +402,6 @@ declare const UseCSPInputSchema: z.ZodEffects<z.ZodObject<{
413
402
  "trusted-types"?: string | boolean | string[] | undefined;
414
403
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
415
404
  } | undefined;
416
- hostname?: string | undefined;
417
405
  }, {
418
406
  mode?: "disabled" | "report-only" | "enforced" | undefined;
419
407
  directives?: string | {
@@ -444,7 +432,6 @@ declare const UseCSPInputSchema: z.ZodEffects<z.ZodObject<{
444
432
  "trusted-types"?: string | boolean | string[] | undefined;
445
433
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
446
434
  } | undefined;
447
- hostname?: string | undefined;
448
435
  }>, {
449
436
  mode: "disabled" | "report-only" | "enforced";
450
437
  directives?: {
@@ -475,7 +462,6 @@ declare const UseCSPInputSchema: z.ZodEffects<z.ZodObject<{
475
462
  "trusted-types"?: string | boolean | string[] | undefined;
476
463
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
477
464
  } | undefined;
478
- hostname?: string | undefined;
479
465
  }, {
480
466
  mode?: "disabled" | "report-only" | "enforced" | undefined;
481
467
  directives?: string | {
@@ -506,10 +492,7 @@ declare const UseCSPInputSchema: z.ZodEffects<z.ZodObject<{
506
492
  "trusted-types"?: string | boolean | string[] | undefined;
507
493
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
508
494
  } | undefined;
509
- hostname?: string | undefined;
510
495
  }>;
511
496
  type UseCSPInput = z.infer<typeof UseCSPInputSchema>;
512
497
 
513
- declare const useContentSecurityPolicy: (input: UseCSPInput) => Middleware;
514
-
515
- export { type Bindings as B, CSPDirectivesSchema as C, type Middleware as M, CSPModeSchema as a, useContentSecurityPolicy as u };
498
+ export { type Bindings as B, CSPDirectivesSchema as C, type UseCSPInput as U, CSPModeSchema as a };
@@ -0,0 +1,17 @@
1
+ import { U as UseCSPInput } from './use-content-security-policy-DUYpyUPy.js';
2
+ import { z } from 'zod';
3
+
4
+ interface MiddlewareContext {
5
+ hostname: string;
6
+ request: Request;
7
+ response: Response;
8
+ waitUntil: ExecutionContext["waitUntil"];
9
+ debug: (...msg: any[]) => void;
10
+ }
11
+ type Middleware = (context: MiddlewareContext, next: () => MiddlewareNextSchemaType) => MiddlewareNextSchemaType;
12
+ declare const MiddlewareNextSchema: z.ZodUnion<[z.ZodVoid, z.ZodNull, z.ZodPromise<z.ZodUnion<[z.ZodVoid, z.ZodNull]>>]>;
13
+ type MiddlewareNextSchemaType = z.infer<typeof MiddlewareNextSchema>;
14
+
15
+ declare const useContentSecurityPolicy: (input: UseCSPInput) => Middleware;
16
+
17
+ export { type Middleware as M, useContentSecurityPolicy as u };