@appwarden/middleware 3.14.0 → 3.15.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/cloudflare.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  UseAppwardenInputSchema,
3
3
  lockPageSlugRefinement
4
- } from "./chunk-HKPJZTYK.js";
4
+ } from "./chunk-PIVEQ7QB.js";
5
5
  import {
6
6
  getErrors
7
7
  } from "./chunk-NV7K5PRA.js";
8
8
  import {
9
9
  useContentSecurityPolicy
10
- } from "./chunk-YPF5MTU3.js";
10
+ } from "./chunk-3CC6CMAB.js";
11
11
  import {
12
12
  checkLockStatus
13
- } from "./chunk-GMWSGC6T.js";
13
+ } from "./chunk-PZ3M7SYD.js";
14
14
  import {
15
15
  buildLockPageUrl,
16
16
  createHeartbeatConfigError,
@@ -20,12 +20,13 @@ import {
20
20
  isHTMLRequest,
21
21
  isHeartbeatRequest,
22
22
  isOnLockPage,
23
+ parseMergedConfig,
23
24
  printMessage,
24
25
  sanitizeConfigErrors
25
- } from "./chunk-NC2TN3D5.js";
26
+ } from "./chunk-2R3NOSYY.js";
26
27
  import {
27
28
  HEARTBEAT_SERVICES
28
- } from "./chunk-FE7E5Q5F.js";
29
+ } from "./chunk-4U4OJ6SP.js";
29
30
 
30
31
  // src/runners/appwarden-on-cloudflare.ts
31
32
  import { ZodError } from "zod";
@@ -128,6 +129,16 @@ var useFetchOrigin = () => async (context, next) => {
128
129
  };
129
130
 
130
131
  // src/runners/appwarden-on-cloudflare.ts
132
+ var RefinedUseAppwardenInputSchema = lockPageSlugRefinement(
133
+ UseAppwardenInputSchema
134
+ );
135
+ function getAppwardenConfiguration(generatedConfig, config) {
136
+ return parseMergedConfig(
137
+ generatedConfig,
138
+ config,
139
+ RefinedUseAppwardenInputSchema.parse
140
+ );
141
+ }
131
142
  var appwardenOnCloudflare = (inputFn) => async (request, env, ctx) => {
132
143
  ctx.passThroughOnException();
133
144
  const requestUrl = new URL(request.url);
@@ -223,5 +234,6 @@ var appwardenOnCloudflare = (inputFn) => async (request, env, ctx) => {
223
234
  var createAppwardenMiddleware = appwardenOnCloudflare;
224
235
  export {
225
236
  createAppwardenMiddleware,
237
+ getAppwardenConfiguration,
226
238
  useContentSecurityPolicy
227
239
  };
package/index.d.ts CHANGED
@@ -198,7 +198,7 @@ declare const isValidCacheUrl: {
198
198
 
199
199
  declare const UseAppwardenInputSchema: z.ZodObject<{
200
200
  debug: z.ZodDefault<z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>, boolean, string | boolean | undefined>>;
201
- lockPageSlug: z.ZodOptional<z.ZodString>;
201
+ lockPageSlug: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
202
202
  contentSecurityPolicy: z.ZodOptional<z.ZodLazy<z.ZodObject<{
203
203
  mode: z.ZodUnion<[z.ZodLiteral<"disabled">, z.ZodLiteral<"report-only">, z.ZodLiteral<"enforced">]>;
204
204
  directives: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -453,7 +453,7 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
453
453
  };
454
454
  }>>>;
455
455
  multidomainConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
456
- lockPageSlug: z.ZodString;
456
+ lockPageSlug: z.ZodEffects<z.ZodString, string, string>;
457
457
  contentSecurityPolicy: z.ZodOptional<z.ZodLazy<z.ZodObject<{
458
458
  mode: z.ZodUnion<[z.ZodLiteral<"disabled">, z.ZodLiteral<"report-only">, z.ZodLiteral<"enforced">]>;
459
459
  directives: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodObject<{
@@ -778,7 +778,7 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
778
778
  debug?: string | boolean | undefined;
779
779
  }>>>;
780
780
  appwardenApiToken: z.ZodEffects<z.ZodString, string, string>;
781
- appwardenApiHostname: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
781
+ appwardenApiHostname: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
782
782
  }, "strip", z.ZodTypeAny, {
783
783
  debug: boolean;
784
784
  appwardenApiToken: string;
package/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-QEFORWCW.js";
6
6
  import {
7
7
  UseAppwardenInputSchema
8
- } from "./chunk-HKPJZTYK.js";
8
+ } from "./chunk-PIVEQ7QB.js";
9
9
  import {
10
10
  APPWARDEN_CACHE_KEY,
11
11
  APPWARDEN_HEARTBEAT_ROUTE,
@@ -28,7 +28,7 @@ import {
28
28
  HeartbeatResponseBodySchema,
29
29
  LOCKDOWN_TEST_EXPIRY_MS,
30
30
  validateHeartbeatResponseBody
31
- } from "./chunk-FE7E5Q5F.js";
31
+ } from "./chunk-4U4OJ6SP.js";
32
32
  export {
33
33
  APPWARDEN_CACHE_KEY,
34
34
  APPWARDEN_HEARTBEAT_ROUTE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appwarden/middleware",
3
- "version": "3.14.0",
3
+ "version": "3.15.0",
4
4
  "description": "Instantly disable all user interaction with your app deployed on Cloudflare or Vercel",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,6 +23,9 @@
23
23
  ],
24
24
  "main": "./index.js",
25
25
  "types": "./index.d.ts",
26
+ "bin": {
27
+ "appwarden-link": "./scripts/appwarden-link.cjs"
28
+ },
26
29
  "exports": {
27
30
  ".": {
28
31
  "types": "./index.d.ts",
@@ -55,11 +58,12 @@
55
58
  },
56
59
  "packageManager": "pnpm@10.4.1",
57
60
  "engines": {
58
- "node": ">=24"
61
+ "node": ">=22.14.0"
59
62
  },
60
63
  "dependencies": {
61
- "@upstash/redis": "^1.37.0",
64
+ "@upstash/redis": "^1.38.0",
62
65
  "@vercel/edge-config": "^1.4.3",
66
+ "acorn": "^8.16.0",
63
67
  "zod": "^3.25.76"
64
68
  },
65
69
  "peerDependencies": {
@@ -100,29 +104,47 @@
100
104
  "@isaacs/brace-expansion@<=5.0.0": ">=5.0.1",
101
105
  "@opennextjs/cloudflare@<1.17.1": ">=1.17.1",
102
106
  "@smithy/config-resolver@<4.4.0": ">=4.4.0",
107
+ "@tanstack/start-server-core@<1.167.30": ">=1.169.4",
108
+ "@tanstack/start-server-core@1.163.2>h3-v2": "npm:h3@2.0.1-rc.22",
103
109
  "ajv@>=7.0.0-alpha.0 <8.18.0": ">=8.18.0",
104
110
  "body-parser@>=2.2.0 <2.2.1": ">=2.2.1",
111
+ "brace-expansion@<5.0.6": ">=5.0.6",
105
112
  "cookie@<0.7.0": ">=0.7.0",
106
- "devalue@<5.6.4": ">=5.6.4",
113
+ "devalue@<5.8.1": ">=5.8.1",
114
+ "dompurify@<=3.3.1": ">=3.3.2",
107
115
  "esbuild@<=0.24.2": ">=0.25.0",
108
- "fast-xml-parser@>=4.0.0-beta.3 <=5.5.5": ">=5.5.6",
116
+ "fast-uri@<=3.1.1": ">=3.1.2",
117
+ "fast-xml-parser@<5.7.0": ">=5.7.3",
118
+ "flatted@<3.4.2": ">=3.4.2",
109
119
  "h3@<1.15.6": ">=1.15.6",
110
- "h3@>=2.0.0 <=2.0.1-rc.14": ">=2.0.1-rc.15",
120
+ "h3@>=2.0.0-beta.0 <2.0.1-rc.18": ">=2.0.1-rc.22",
121
+ "handlebars@4.7.8": "4.7.9",
111
122
  "js-yaml@<3.14.2": ">=3.14.2",
112
123
  "jws@=4.0.0": ">=4.0.1",
124
+ "lodash@>=4.0.0 <=4.17.23": ">=4.18.1",
125
+ "lodash-es@>=4.0.0 <=4.17.23": ">=4.18.1",
126
+ "mermaid@<10.9.5": ">=10.9.5",
113
127
  "minimatch@<10.2.1": ">=10.2.3",
114
- "next@>=10.0.0 <16.1.7": ">=16.1.7",
128
+ "next@<16.2.6": ">=16.2.6",
129
+ "nitropack@<2.13.4": ">=2.13.4",
115
130
  "npm@<=11.8.0": ">=11.9.0",
116
131
  "path-to-regexp@>=4.0.0 <6.3.0": ">=6.3.0",
117
132
  "picomatch@<4.0.4": ">=4.0.4",
118
- "qs@>=6.7.0 <=6.14.1": ">=6.14.2",
133
+ "qs@<=6.15.1": ">=6.15.2",
119
134
  "rollup@>=4.0.0 <4.59.0": ">=4.59.0",
120
135
  "serialize-javascript@<=7.0.2": ">=7.0.3",
121
136
  "svgo@=4.0.0": ">=4.0.1",
122
137
  "tar@<=7.5.10": ">=7.5.11",
123
138
  "undici@<7.24.0": ">=7.24.0",
124
139
  "wrangler@>=4.0.0 <4.59.1": ">=4.59.1",
125
- "@tanstack/start-server-core@1.163.2>h3-v2": "npm:h3@2.0.1-rc.16"
140
+ "defu@<=6.1.4": ">=6.1.5",
141
+ "vite@<=6.4.1": ">=6.4.2",
142
+ "vite@>=7.0.0 <=7.3.1": ">=7.3.2",
143
+ "vite@>=7.1.0 <=7.3.1": ">=7.3.2",
144
+ "vite@>=6.0.0 <=6.4.1": ">=6.4.2",
145
+ "follow-redirects@<=1.15.11": ">=1.16.0",
146
+ "postcss@<8.5.10": ">=8.5.15",
147
+ "ws@<8.20.1": ">=8.20.1"
126
148
  }
127
149
  }
128
150
  }