@appwarden/middleware 3.14.1 → 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-JJOX4UAG.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-DM57ZOTI.js";
10
+ } from "./chunk-3CC6CMAB.js";
11
11
  import {
12
12
  checkLockStatus
13
- } from "./chunk-PCWFMNHW.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-2FSRHIPY.js";
26
+ } from "./chunk-2R3NOSYY.js";
26
27
  import {
27
28
  HEARTBEAT_SERVICES
28
- } from "./chunk-LDKC5DRW.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<{
@@ -710,7 +710,6 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
710
710
  debug: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>, boolean, string | boolean | undefined>>;
711
711
  }, "strip", z.ZodTypeAny, {
712
712
  lockPageSlug: string;
713
- debug?: boolean | undefined;
714
713
  contentSecurityPolicy?: {
715
714
  mode: "disabled" | "report-only" | "enforced";
716
715
  directives?: {
@@ -742,9 +741,9 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
742
741
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
743
742
  } | undefined;
744
743
  } | undefined;
744
+ debug?: boolean | undefined;
745
745
  }, {
746
746
  lockPageSlug: string;
747
- debug?: string | boolean | undefined;
748
747
  contentSecurityPolicy?: {
749
748
  mode: "disabled" | "report-only" | "enforced";
750
749
  directives: string | {
@@ -776,9 +775,10 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
776
775
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
777
776
  };
778
777
  } | undefined;
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;
@@ -816,7 +816,6 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
816
816
  } | undefined;
817
817
  multidomainConfig?: Record<string, {
818
818
  lockPageSlug: string;
819
- debug?: boolean | undefined;
820
819
  contentSecurityPolicy?: {
821
820
  mode: "disabled" | "report-only" | "enforced";
822
821
  directives?: {
@@ -848,11 +847,11 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
848
847
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
849
848
  } | undefined;
850
849
  } | undefined;
850
+ debug?: boolean | undefined;
851
851
  }> | undefined;
852
852
  appwardenApiHostname?: string | undefined;
853
853
  }, {
854
854
  appwardenApiToken: string;
855
- debug?: string | boolean | undefined;
856
855
  lockPageSlug?: string | undefined;
857
856
  contentSecurityPolicy?: {
858
857
  mode: "disabled" | "report-only" | "enforced";
@@ -885,9 +884,9 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
885
884
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
886
885
  };
887
886
  } | undefined;
887
+ debug?: string | boolean | undefined;
888
888
  multidomainConfig?: Record<string, {
889
889
  lockPageSlug: string;
890
- debug?: string | boolean | undefined;
891
890
  contentSecurityPolicy?: {
892
891
  mode: "disabled" | "report-only" | "enforced";
893
892
  directives: string | {
@@ -919,6 +918,7 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
919
918
  "require-trusted-types-for"?: string | boolean | string[] | undefined;
920
919
  };
921
920
  } | undefined;
921
+ debug?: string | boolean | undefined;
922
922
  }> | undefined;
923
923
  appwardenApiHostname?: string | undefined;
924
924
  }>;
package/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-QEFORWCW.js";
6
6
  import {
7
7
  UseAppwardenInputSchema
8
- } from "./chunk-JJOX4UAG.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-LDKC5DRW.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.1",
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",
@@ -58,8 +61,9 @@
58
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,16 +104,20 @@
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",
107
114
  "dompurify@<=3.3.1": ">=3.3.2",
108
115
  "esbuild@<=0.24.2": ">=0.25.0",
109
- "fast-xml-parser@5.3.4": "5.5.10",
116
+ "fast-uri@<=3.1.1": ">=3.1.2",
117
+ "fast-xml-parser@<5.7.0": ">=5.7.3",
110
118
  "flatted@<3.4.2": ">=3.4.2",
111
119
  "h3@<1.15.6": ">=1.15.6",
112
- "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",
113
121
  "handlebars@4.7.8": "4.7.9",
114
122
  "js-yaml@<3.14.2": ">=3.14.2",
115
123
  "jws@=4.0.0": ">=4.0.1",
@@ -117,28 +125,26 @@
117
125
  "lodash-es@>=4.0.0 <=4.17.23": ">=4.18.1",
118
126
  "mermaid@<10.9.5": ">=10.9.5",
119
127
  "minimatch@<10.2.1": ">=10.2.3",
120
- "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",
121
130
  "npm@<=11.8.0": ">=11.9.0",
122
131
  "path-to-regexp@>=4.0.0 <6.3.0": ">=6.3.0",
123
132
  "picomatch@<4.0.4": ">=4.0.4",
124
- "qs@>=6.7.0 <=6.14.1": ">=6.14.2",
133
+ "qs@<=6.15.1": ">=6.15.2",
125
134
  "rollup@>=4.0.0 <4.59.0": ">=4.59.0",
126
135
  "serialize-javascript@<=7.0.2": ">=7.0.3",
127
136
  "svgo@=4.0.0": ">=4.0.1",
128
137
  "tar@<=7.5.10": ">=7.5.11",
129
138
  "undici@<7.24.0": ">=7.24.0",
130
139
  "wrangler@>=4.0.0 <4.59.1": ">=4.59.1",
131
- "@tanstack/start-server-core@1.163.2>h3-v2": "npm:h3@2.0.1-rc.16",
132
- "h3@>=2.0.0-beta.0 <=2.0.1-rc.16": ">=2.0.1-rc.17",
133
- "h3@>=2.0.0-beta.4 <2.0.1-rc.18": ">=2.0.1-rc.18",
134
- "h3@>=2.0.1-alpha.0 <=2.0.1-rc.16": ">=2.0.1-rc.17",
135
140
  "defu@<=6.1.4": ">=6.1.5",
136
141
  "vite@<=6.4.1": ">=6.4.2",
137
142
  "vite@>=7.0.0 <=7.3.1": ">=7.3.2",
138
143
  "vite@>=7.1.0 <=7.3.1": ">=7.3.2",
139
144
  "vite@>=6.0.0 <=6.4.1": ">=6.4.2",
140
- "next@>=16.0.0-beta.0 <16.2.3": ">=16.2.3",
141
- "follow-redirects@<=1.15.11": ">=1.16.0"
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"
142
148
  }
143
149
  }
144
150
  }