@appwarden/middleware 3.13.0 → 3.13.1
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/README.md +7 -1
- package/{chunk-HP5GMFH7.js → chunk-CVOSFBOE.js} +2 -2
- package/{chunk-SREQAAZC.js → chunk-OIEAURS7.js} +2 -0
- package/{chunk-J2TA6BEU.js → chunk-Q5LVKCWK.js} +2 -2
- package/{chunk-TBSMAMWC.js → chunk-QM56445N.js} +1 -1
- package/{chunk-2ZSJUEHK.js → chunk-U7E4KM2B.js} +2 -2
- package/{chunk-GNDWHKJ5.js → chunk-UBWPR24M.js} +1 -1
- package/cloudflare/astro.d.ts +2 -2
- package/cloudflare/astro.js +5 -5
- package/cloudflare/nextjs.d.ts +2 -2
- package/cloudflare/nextjs.js +3 -3
- package/cloudflare/react-router.d.ts +2 -2
- package/cloudflare/react-router.js +5 -5
- package/cloudflare/tanstack-start.d.ts +2 -2
- package/cloudflare/tanstack-start.js +5 -5
- package/cloudflare.js +5 -5
- package/index.d.ts +43 -1
- package/index.js +26 -2
- package/package.json +2 -2
- package/vercel.js +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/appwarden/middleware)
|
|
5
5
|
[](https://www.npmjs.com/package/@appwarden/middleware)
|
|
6
6
|
[](https://docs.npmjs.com/generating-provenance-statements)
|
|
7
|
-

|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
|
|
10
10
|
## Core Features
|
|
@@ -320,6 +320,12 @@ Please review our [security policy](SECURITY.md) for details on how we handle vu
|
|
|
320
320
|
|
|
321
321
|
This package is published with npm trusted publishers, to prevent npm token exfiltration, and provenance enabled, which provides a verifiable link between the published package and its source code. For more information, see [npm provenance documentation](https://docs.npmjs.com/generating-provenance-statements).
|
|
322
322
|
|
|
323
|
+
## Versioning & dependencies
|
|
324
|
+
|
|
325
|
+
- This project uses Conventional Commits and automated release tooling to keep versions and the changelog up to date.
|
|
326
|
+
- Patch releases may include bug fixes and internal maintenance or dependency updates (for example, Cloudflare Workers types, Wrangler, and GitHub Action tooling). New features are shipped in minor releases.
|
|
327
|
+
- See `CHANGELOG.md` for the complete release history.
|
|
328
|
+
|
|
323
329
|
## License
|
|
324
330
|
|
|
325
331
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
MemoryCache,
|
|
3
3
|
debug,
|
|
4
4
|
printMessage
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-U7E4KM2B.js";
|
|
6
6
|
import {
|
|
7
7
|
APPWARDEN_CACHE_KEY,
|
|
8
8
|
APPWARDEN_TEST_ROUTE,
|
|
9
9
|
LockValue
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OIEAURS7.js";
|
|
11
11
|
|
|
12
12
|
// src/utils/cloudflare/cloudflare-cache.ts
|
|
13
13
|
var store = {
|
|
@@ -198,6 +198,7 @@ export {
|
|
|
198
198
|
APPWARDEN_TEST_ROUTE,
|
|
199
199
|
APPWARDEN_HEARTBEAT_ROUTE,
|
|
200
200
|
HEARTBEAT_CONTRACT_VERSION,
|
|
201
|
+
HEARTBEAT_VERSION_MAX_LENGTH,
|
|
201
202
|
HEARTBEAT_CONFIG_ERROR_MAX_COUNT,
|
|
202
203
|
HEARTBEAT_CONFIG_ERROR_MAX_PATH_DEPTH,
|
|
203
204
|
HEARTBEAT_CONFIG_ERROR_MAX_CODE_LENGTH,
|
|
@@ -206,6 +207,7 @@ export {
|
|
|
206
207
|
HEARTBEAT_RESPONSE_BODY_MAX_SERIALIZED_BYTES,
|
|
207
208
|
HEARTBEAT_CONFIG_ERROR_MAX_PATH_SEGMENT_LENGTH,
|
|
208
209
|
APPWARDEN_CACHE_KEY,
|
|
210
|
+
HEARTBEAT_SERVICE_VALUES,
|
|
209
211
|
HEARTBEAT_SERVICES,
|
|
210
212
|
BooleanSchema,
|
|
211
213
|
AppwardenApiTokenSchema,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isHTMLResponse,
|
|
3
3
|
makeCSPHeader
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-U7E4KM2B.js";
|
|
5
5
|
import {
|
|
6
6
|
UseCSPInputSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OIEAURS7.js";
|
|
8
8
|
|
|
9
9
|
// src/middlewares/use-content-security-policy.ts
|
|
10
10
|
var AppendAttribute = (attribute, nonce) => ({
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
HEARTBEAT_RESPONSE_BODY_MAX_SERIALIZED_BYTES,
|
|
11
11
|
LOCKDOWN_TEST_EXPIRY_MS,
|
|
12
12
|
validateHeartbeatResponseBody
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OIEAURS7.js";
|
|
14
14
|
|
|
15
15
|
// src/utils/build-lock-page-url.ts
|
|
16
16
|
function normalizeLockPageSlug(lockPageSlug) {
|
|
@@ -122,7 +122,7 @@ var MemoryCache = class {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
// src/version.ts
|
|
125
|
-
var MIDDLEWARE_VERSION = "3.
|
|
125
|
+
var MIDDLEWARE_VERSION = "3.13.0";
|
|
126
126
|
|
|
127
127
|
// src/utils/heartbeat.ts
|
|
128
128
|
var DEFAULT_HEARTBEAT_CONFIG_ERROR_CODE = "custom";
|
package/cloudflare/astro.d.ts
CHANGED
|
@@ -270,8 +270,8 @@ declare const AstroCloudflareConfigSchema: z.ZodObject<{
|
|
|
270
270
|
};
|
|
271
271
|
}>>>;
|
|
272
272
|
}, "strip", z.ZodTypeAny, {
|
|
273
|
-
lockPageSlug: string;
|
|
274
273
|
debug: boolean;
|
|
274
|
+
lockPageSlug: string;
|
|
275
275
|
appwardenApiToken: string;
|
|
276
276
|
contentSecurityPolicy?: {
|
|
277
277
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -308,6 +308,7 @@ declare const AstroCloudflareConfigSchema: z.ZodObject<{
|
|
|
308
308
|
}, {
|
|
309
309
|
lockPageSlug: string;
|
|
310
310
|
appwardenApiToken: string;
|
|
311
|
+
debug?: string | boolean | undefined;
|
|
311
312
|
contentSecurityPolicy?: {
|
|
312
313
|
mode: "disabled" | "report-only" | "enforced";
|
|
313
314
|
directives: string | {
|
|
@@ -339,7 +340,6 @@ declare const AstroCloudflareConfigSchema: z.ZodObject<{
|
|
|
339
340
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
340
341
|
};
|
|
341
342
|
} | undefined;
|
|
342
|
-
debug?: string | boolean | undefined;
|
|
343
343
|
appwardenApiHostname?: string | undefined;
|
|
344
344
|
}>;
|
|
345
345
|
type AstroCloudflareConfig = z.infer<typeof AstroCloudflareConfigSchema>;
|
package/cloudflare/astro.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyContentSecurityPolicyToResponse,
|
|
3
3
|
isResponseLike
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-QM56445N.js";
|
|
5
|
+
import "../chunk-Q5LVKCWK.js";
|
|
6
6
|
import {
|
|
7
7
|
getNowMs,
|
|
8
8
|
logElapsed
|
|
9
9
|
} from "../chunk-G6BMPIYD.js";
|
|
10
10
|
import {
|
|
11
11
|
checkLockStatus
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-CVOSFBOE.js";
|
|
13
13
|
import {
|
|
14
14
|
TEMPORARY_REDIRECT_STATUS,
|
|
15
15
|
buildLockPageUrl,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
isOnLockPage,
|
|
23
23
|
printMessage,
|
|
24
24
|
sanitizeConfigErrors
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-U7E4KM2B.js";
|
|
26
26
|
import {
|
|
27
27
|
AppwardenApiHostnameSchema,
|
|
28
28
|
AppwardenApiTokenSchema,
|
|
29
29
|
BooleanSchema,
|
|
30
30
|
HEARTBEAT_SERVICES,
|
|
31
31
|
UseCSPInputSchema
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-OIEAURS7.js";
|
|
33
33
|
|
|
34
34
|
// src/adapters/astro-cloudflare.ts
|
|
35
35
|
import { waitUntil } from "cloudflare:workers";
|
package/cloudflare/nextjs.d.ts
CHANGED
|
@@ -329,8 +329,8 @@ declare const NextJsCloudflareConfigSchema: z.ZodObject<{
|
|
|
329
329
|
};
|
|
330
330
|
}>>>;
|
|
331
331
|
}, "strip", z.ZodTypeAny, {
|
|
332
|
-
lockPageSlug: string;
|
|
333
332
|
debug: boolean;
|
|
333
|
+
lockPageSlug: string;
|
|
334
334
|
appwardenApiToken: string;
|
|
335
335
|
contentSecurityPolicy?: {
|
|
336
336
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -367,6 +367,7 @@ declare const NextJsCloudflareConfigSchema: z.ZodObject<{
|
|
|
367
367
|
}, {
|
|
368
368
|
lockPageSlug: string;
|
|
369
369
|
appwardenApiToken: string;
|
|
370
|
+
debug?: string | boolean | undefined;
|
|
370
371
|
contentSecurityPolicy?: {
|
|
371
372
|
mode: "disabled" | "report-only" | "enforced";
|
|
372
373
|
directives: string | {
|
|
@@ -398,7 +399,6 @@ declare const NextJsCloudflareConfigSchema: z.ZodObject<{
|
|
|
398
399
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
399
400
|
};
|
|
400
401
|
} | undefined;
|
|
401
|
-
debug?: string | boolean | undefined;
|
|
402
402
|
appwardenApiHostname?: string | undefined;
|
|
403
403
|
}>;
|
|
404
404
|
type NextJsCloudflareConfig = z.infer<typeof NextJsCloudflareConfigSchema>;
|
package/cloudflare/nextjs.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "../chunk-G6BMPIYD.js";
|
|
8
8
|
import {
|
|
9
9
|
checkLockStatus
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-CVOSFBOE.js";
|
|
11
11
|
import {
|
|
12
12
|
TEMPORARY_REDIRECT_STATUS,
|
|
13
13
|
buildLockPageUrl,
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
makeCSPHeader,
|
|
21
21
|
printMessage,
|
|
22
22
|
sanitizeConfigErrors
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-U7E4KM2B.js";
|
|
24
24
|
import {
|
|
25
25
|
AppwardenApiHostnameSchema,
|
|
26
26
|
AppwardenApiTokenSchema,
|
|
27
27
|
BooleanSchema,
|
|
28
28
|
HEARTBEAT_SERVICES,
|
|
29
29
|
UseCSPInputSchema
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-OIEAURS7.js";
|
|
31
31
|
|
|
32
32
|
// src/adapters/nextjs-cloudflare.ts
|
|
33
33
|
import { getCloudflareContext } from "@opennextjs/cloudflare";
|
|
@@ -268,8 +268,8 @@ declare const ReactRouterCloudflareConfigSchema: z.ZodObject<{
|
|
|
268
268
|
};
|
|
269
269
|
}>>>;
|
|
270
270
|
}, "strip", z.ZodTypeAny, {
|
|
271
|
-
lockPageSlug: string;
|
|
272
271
|
debug: boolean;
|
|
272
|
+
lockPageSlug: string;
|
|
273
273
|
appwardenApiToken: string;
|
|
274
274
|
contentSecurityPolicy?: {
|
|
275
275
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -306,6 +306,7 @@ declare const ReactRouterCloudflareConfigSchema: z.ZodObject<{
|
|
|
306
306
|
}, {
|
|
307
307
|
lockPageSlug: string;
|
|
308
308
|
appwardenApiToken: string;
|
|
309
|
+
debug?: string | boolean | undefined;
|
|
309
310
|
contentSecurityPolicy?: {
|
|
310
311
|
mode: "disabled" | "report-only" | "enforced";
|
|
311
312
|
directives: string | {
|
|
@@ -337,7 +338,6 @@ declare const ReactRouterCloudflareConfigSchema: z.ZodObject<{
|
|
|
337
338
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
338
339
|
};
|
|
339
340
|
} | undefined;
|
|
340
|
-
debug?: string | boolean | undefined;
|
|
341
341
|
appwardenApiHostname?: string | undefined;
|
|
342
342
|
}>;
|
|
343
343
|
type ReactRouterCloudflareConfig = z.infer<typeof ReactRouterCloudflareConfigSchema>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyContentSecurityPolicyToResponse,
|
|
3
3
|
isResponseLike
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-QM56445N.js";
|
|
5
|
+
import "../chunk-Q5LVKCWK.js";
|
|
6
6
|
import {
|
|
7
7
|
getNowMs,
|
|
8
8
|
logElapsed
|
|
9
9
|
} from "../chunk-G6BMPIYD.js";
|
|
10
10
|
import {
|
|
11
11
|
checkLockStatus
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-CVOSFBOE.js";
|
|
13
13
|
import {
|
|
14
14
|
buildLockPageUrl,
|
|
15
15
|
createHeartbeatConfigError,
|
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
isOnLockPage,
|
|
22
22
|
printMessage,
|
|
23
23
|
sanitizeConfigErrors
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-U7E4KM2B.js";
|
|
25
25
|
import {
|
|
26
26
|
AppwardenApiHostnameSchema,
|
|
27
27
|
AppwardenApiTokenSchema,
|
|
28
28
|
BooleanSchema,
|
|
29
29
|
HEARTBEAT_SERVICES,
|
|
30
30
|
UseCSPInputSchema
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-OIEAURS7.js";
|
|
32
32
|
|
|
33
33
|
// src/adapters/react-router-cloudflare.ts
|
|
34
34
|
import { waitUntil } from "cloudflare:workers";
|
|
@@ -268,8 +268,8 @@ declare const TanStackStartCloudflareConfigSchema: z.ZodObject<{
|
|
|
268
268
|
};
|
|
269
269
|
}>>>;
|
|
270
270
|
}, "strip", z.ZodTypeAny, {
|
|
271
|
-
lockPageSlug: string;
|
|
272
271
|
debug: boolean;
|
|
272
|
+
lockPageSlug: string;
|
|
273
273
|
appwardenApiToken: string;
|
|
274
274
|
contentSecurityPolicy?: {
|
|
275
275
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -306,6 +306,7 @@ declare const TanStackStartCloudflareConfigSchema: z.ZodObject<{
|
|
|
306
306
|
}, {
|
|
307
307
|
lockPageSlug: string;
|
|
308
308
|
appwardenApiToken: string;
|
|
309
|
+
debug?: string | boolean | undefined;
|
|
309
310
|
contentSecurityPolicy?: {
|
|
310
311
|
mode: "disabled" | "report-only" | "enforced";
|
|
311
312
|
directives: string | {
|
|
@@ -337,7 +338,6 @@ declare const TanStackStartCloudflareConfigSchema: z.ZodObject<{
|
|
|
337
338
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
338
339
|
};
|
|
339
340
|
} | undefined;
|
|
340
|
-
debug?: string | boolean | undefined;
|
|
341
341
|
appwardenApiHostname?: string | undefined;
|
|
342
342
|
}>;
|
|
343
343
|
type TanStackStartCloudflareConfig = z.infer<typeof TanStackStartCloudflareConfigSchema>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyContentSecurityPolicyToResponse,
|
|
3
3
|
isResponseLike
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-QM56445N.js";
|
|
5
|
+
import "../chunk-Q5LVKCWK.js";
|
|
6
6
|
import {
|
|
7
7
|
getNowMs,
|
|
8
8
|
logElapsed
|
|
9
9
|
} from "../chunk-G6BMPIYD.js";
|
|
10
10
|
import {
|
|
11
11
|
checkLockStatus
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-CVOSFBOE.js";
|
|
13
13
|
import {
|
|
14
14
|
buildLockPageUrl,
|
|
15
15
|
createHeartbeatConfigError,
|
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
isOnLockPage,
|
|
22
22
|
printMessage,
|
|
23
23
|
sanitizeConfigErrors
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-U7E4KM2B.js";
|
|
25
25
|
import {
|
|
26
26
|
AppwardenApiHostnameSchema,
|
|
27
27
|
AppwardenApiTokenSchema,
|
|
28
28
|
BooleanSchema,
|
|
29
29
|
HEARTBEAT_SERVICES,
|
|
30
30
|
UseCSPInputSchema
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-OIEAURS7.js";
|
|
32
32
|
|
|
33
33
|
// src/adapters/tanstack-start-cloudflare.ts
|
|
34
34
|
import { waitUntil } from "cloudflare:workers";
|
package/cloudflare.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UseAppwardenInputSchema,
|
|
3
3
|
lockPageSlugRefinement
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UBWPR24M.js";
|
|
5
5
|
import {
|
|
6
6
|
getErrors
|
|
7
7
|
} from "./chunk-NV7K5PRA.js";
|
|
8
8
|
import {
|
|
9
9
|
useContentSecurityPolicy
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Q5LVKCWK.js";
|
|
11
11
|
import {
|
|
12
12
|
checkLockStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CVOSFBOE.js";
|
|
14
14
|
import {
|
|
15
15
|
buildLockPageUrl,
|
|
16
16
|
createHeartbeatConfigError,
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
isOnLockPage,
|
|
23
23
|
printMessage,
|
|
24
24
|
sanitizeConfigErrors
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-U7E4KM2B.js";
|
|
26
26
|
import {
|
|
27
27
|
HEARTBEAT_SERVICES
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-OIEAURS7.js";
|
|
29
29
|
|
|
30
30
|
// src/runners/appwarden-on-cloudflare.ts
|
|
31
31
|
import { ZodError } from "zod";
|
package/index.d.ts
CHANGED
|
@@ -2,8 +2,50 @@ export { B as Bindings, C as CSPDirectivesSchema, a as CSPModeSchema, M as Middl
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare const LOCKDOWN_TEST_EXPIRY_MS: number;
|
|
5
|
+
declare const APPWARDEN_HEARTBEAT_ROUTE = "/_appwarden/heartbeat";
|
|
6
|
+
declare const HEARTBEAT_CONTRACT_VERSION: 1;
|
|
7
|
+
declare const HEARTBEAT_VERSION_MAX_LENGTH = 128;
|
|
8
|
+
/**
|
|
9
|
+
* Maximum number of public heartbeat config errors.
|
|
10
|
+
* Prevents unbounded response sizes.
|
|
11
|
+
*/
|
|
12
|
+
declare const HEARTBEAT_CONFIG_ERROR_MAX_COUNT = 10;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum path depth for public heartbeat config errors.
|
|
15
|
+
* Prevents deeply nested paths from being exposed.
|
|
16
|
+
*/
|
|
17
|
+
declare const HEARTBEAT_CONFIG_ERROR_MAX_PATH_DEPTH = 10;
|
|
18
|
+
/**
|
|
19
|
+
* Maximum length for public heartbeat config error codes.
|
|
20
|
+
* Keeps error codes within the contract bounds.
|
|
21
|
+
*/
|
|
22
|
+
declare const HEARTBEAT_CONFIG_ERROR_MAX_CODE_LENGTH = 100;
|
|
23
|
+
/**
|
|
24
|
+
* Maximum length for public heartbeat config error messages.
|
|
25
|
+
* Prevents excessively long messages from being exposed.
|
|
26
|
+
*/
|
|
27
|
+
declare const HEARTBEAT_CONFIG_ERROR_MAX_MESSAGE_LENGTH = 500;
|
|
28
|
+
declare const HEARTBEAT_CONFIG_ERRORS_MAX_SERIALIZED_BYTES: number;
|
|
29
|
+
declare const HEARTBEAT_RESPONSE_BODY_MAX_SERIALIZED_BYTES: number;
|
|
30
|
+
/**
|
|
31
|
+
* Maximum length for individual public heartbeat config error path segments.
|
|
32
|
+
* Prevents excessively long path segments from being exposed.
|
|
33
|
+
*/
|
|
34
|
+
declare const HEARTBEAT_CONFIG_ERROR_MAX_PATH_SEGMENT_LENGTH = 100;
|
|
5
35
|
declare const APPWARDEN_CACHE_KEY: "appwarden-lock";
|
|
6
36
|
declare const HEARTBEAT_SERVICE_VALUES: readonly ["cloudflare", "cloudflare-astro", "cloudflare-react-router", "cloudflare-tanstack-start", "cloudflare-nextjs", "vercel"];
|
|
37
|
+
/**
|
|
38
|
+
* Service identifiers for different middleware adapters.
|
|
39
|
+
* These are hardcoded per adapter bundle.
|
|
40
|
+
*/
|
|
41
|
+
declare const HEARTBEAT_SERVICES: {
|
|
42
|
+
readonly CLOUDFLARE: "cloudflare";
|
|
43
|
+
readonly CLOUDFLARE_ASTRO: "cloudflare-astro";
|
|
44
|
+
readonly CLOUDFLARE_REACT_ROUTER: "cloudflare-react-router";
|
|
45
|
+
readonly CLOUDFLARE_TANSTACK_START: "cloudflare-tanstack-start";
|
|
46
|
+
readonly CLOUDFLARE_NEXTJS: "cloudflare-nextjs";
|
|
47
|
+
readonly VERCEL: "vercel";
|
|
48
|
+
};
|
|
7
49
|
|
|
8
50
|
/**
|
|
9
51
|
* Service identifiers for different middleware adapters.
|
|
@@ -894,4 +936,4 @@ declare const LockValue: z.ZodObject<{
|
|
|
894
936
|
}>;
|
|
895
937
|
type LockValueType = z.infer<typeof LockValue>;
|
|
896
938
|
|
|
897
|
-
export { APPWARDEN_CACHE_KEY, type HeartbeatConfigError, HeartbeatConfigErrorSchema, type HeartbeatResponseBody, HeartbeatResponseBodySchema, type HeartbeatService, LOCKDOWN_TEST_EXPIRY_MS, type LockValueType, UseAppwardenInputSchema, getEdgeConfigId, isCacheUrl, isValidCacheUrl, validateHeartbeatResponseBody };
|
|
939
|
+
export { APPWARDEN_CACHE_KEY, APPWARDEN_HEARTBEAT_ROUTE, HEARTBEAT_CONFIG_ERRORS_MAX_SERIALIZED_BYTES, HEARTBEAT_CONFIG_ERROR_MAX_CODE_LENGTH, HEARTBEAT_CONFIG_ERROR_MAX_COUNT, HEARTBEAT_CONFIG_ERROR_MAX_MESSAGE_LENGTH, HEARTBEAT_CONFIG_ERROR_MAX_PATH_DEPTH, HEARTBEAT_CONFIG_ERROR_MAX_PATH_SEGMENT_LENGTH, HEARTBEAT_CONTRACT_VERSION, HEARTBEAT_RESPONSE_BODY_MAX_SERIALIZED_BYTES, HEARTBEAT_SERVICES, HEARTBEAT_SERVICE_VALUES, HEARTBEAT_VERSION_MAX_LENGTH, type HeartbeatConfigError, HeartbeatConfigErrorSchema, type HeartbeatResponseBody, HeartbeatResponseBodySchema, type HeartbeatService, LOCKDOWN_TEST_EXPIRY_MS, type LockValueType, UseAppwardenInputSchema, getEdgeConfigId, isCacheUrl, isValidCacheUrl, validateHeartbeatResponseBody };
|
package/index.js
CHANGED
|
@@ -5,20 +5,44 @@ import {
|
|
|
5
5
|
} from "./chunk-QEFORWCW.js";
|
|
6
6
|
import {
|
|
7
7
|
UseAppwardenInputSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UBWPR24M.js";
|
|
9
9
|
import {
|
|
10
10
|
APPWARDEN_CACHE_KEY,
|
|
11
|
+
APPWARDEN_HEARTBEAT_ROUTE,
|
|
11
12
|
CSPDirectivesSchema,
|
|
12
13
|
CSPModeSchema,
|
|
14
|
+
HEARTBEAT_CONFIG_ERRORS_MAX_SERIALIZED_BYTES,
|
|
15
|
+
HEARTBEAT_CONFIG_ERROR_MAX_CODE_LENGTH,
|
|
16
|
+
HEARTBEAT_CONFIG_ERROR_MAX_COUNT,
|
|
17
|
+
HEARTBEAT_CONFIG_ERROR_MAX_MESSAGE_LENGTH,
|
|
18
|
+
HEARTBEAT_CONFIG_ERROR_MAX_PATH_DEPTH,
|
|
19
|
+
HEARTBEAT_CONFIG_ERROR_MAX_PATH_SEGMENT_LENGTH,
|
|
20
|
+
HEARTBEAT_CONTRACT_VERSION,
|
|
21
|
+
HEARTBEAT_RESPONSE_BODY_MAX_SERIALIZED_BYTES,
|
|
22
|
+
HEARTBEAT_SERVICES,
|
|
23
|
+
HEARTBEAT_SERVICE_VALUES,
|
|
24
|
+
HEARTBEAT_VERSION_MAX_LENGTH,
|
|
13
25
|
HeartbeatConfigErrorSchema,
|
|
14
26
|
HeartbeatResponseBodySchema,
|
|
15
27
|
LOCKDOWN_TEST_EXPIRY_MS,
|
|
16
28
|
validateHeartbeatResponseBody
|
|
17
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-OIEAURS7.js";
|
|
18
30
|
export {
|
|
19
31
|
APPWARDEN_CACHE_KEY,
|
|
32
|
+
APPWARDEN_HEARTBEAT_ROUTE,
|
|
20
33
|
CSPDirectivesSchema,
|
|
21
34
|
CSPModeSchema,
|
|
35
|
+
HEARTBEAT_CONFIG_ERRORS_MAX_SERIALIZED_BYTES,
|
|
36
|
+
HEARTBEAT_CONFIG_ERROR_MAX_CODE_LENGTH,
|
|
37
|
+
HEARTBEAT_CONFIG_ERROR_MAX_COUNT,
|
|
38
|
+
HEARTBEAT_CONFIG_ERROR_MAX_MESSAGE_LENGTH,
|
|
39
|
+
HEARTBEAT_CONFIG_ERROR_MAX_PATH_DEPTH,
|
|
40
|
+
HEARTBEAT_CONFIG_ERROR_MAX_PATH_SEGMENT_LENGTH,
|
|
41
|
+
HEARTBEAT_CONTRACT_VERSION,
|
|
42
|
+
HEARTBEAT_RESPONSE_BODY_MAX_SERIALIZED_BYTES,
|
|
43
|
+
HEARTBEAT_SERVICES,
|
|
44
|
+
HEARTBEAT_SERVICE_VALUES,
|
|
45
|
+
HEARTBEAT_VERSION_MAX_LENGTH,
|
|
22
46
|
HeartbeatConfigErrorSchema,
|
|
23
47
|
HeartbeatResponseBodySchema,
|
|
24
48
|
LOCKDOWN_TEST_EXPIRY_MS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appwarden/middleware",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.1",
|
|
4
4
|
"description": "Instantly disable all user interaction with your app deployed on Cloudflare or Vercel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"node": ">=24"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@upstash/redis": "^1.36.
|
|
61
|
+
"@upstash/redis": "^1.36.4",
|
|
62
62
|
"@vercel/edge-config": "^1.4.3",
|
|
63
63
|
"zod": "^3.25.76"
|
|
64
64
|
},
|
package/vercel.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
makeCSPHeader,
|
|
21
21
|
printMessage,
|
|
22
22
|
sanitizeConfigErrors
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-U7E4KM2B.js";
|
|
24
24
|
import {
|
|
25
25
|
APPWARDEN_CACHE_KEY,
|
|
26
26
|
AppwardenApiHostnameSchema,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
LockValue,
|
|
31
31
|
errors,
|
|
32
32
|
globalErrors
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OIEAURS7.js";
|
|
34
34
|
|
|
35
35
|
// src/runners/appwarden-on-vercel.ts
|
|
36
36
|
import { waitUntil } from "@vercel/functions";
|