@appwarden/middleware 3.15.0 → 3.15.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 +1 -1
- package/{chunk-2R3NOSYY.js → chunk-2ZKE4AI4.js} +1 -1
- package/{chunk-PIVEQ7QB.js → chunk-IAOONP5L.js} +1 -1
- package/{chunk-PZ3M7SYD.js → chunk-L4UHIU77.js} +2 -2
- package/{chunk-55QG265Y.js → chunk-LRDZKQI3.js} +1 -1
- package/{chunk-4U4OJ6SP.js → chunk-TXFZUVJP.js} +1 -1
- package/{chunk-3CC6CMAB.js → chunk-YJSTNZGA.js} +8 -3
- package/cloudflare/astro.js +5 -5
- package/cloudflare/nextjs.js +3 -3
- package/cloudflare/react-router.js +5 -5
- package/cloudflare/tanstack-start.js +5 -5
- package/cloudflare.d.ts +10 -10
- package/cloudflare.js +14 -8
- package/index.d.ts +5 -5
- package/index.js +2 -2
- package/package.json +1 -1
- package/vercel.d.ts +10 -10
- 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
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
MemoryCache,
|
|
3
3
|
debug,
|
|
4
4
|
printMessage
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2ZKE4AI4.js";
|
|
6
6
|
import {
|
|
7
7
|
APPWARDEN_CACHE_KEY,
|
|
8
8
|
APPWARDEN_MIDDLEWARE_USER_AGENT,
|
|
9
9
|
APPWARDEN_TEST_ROUTE,
|
|
10
10
|
AppwardenApiHostnameSchema,
|
|
11
11
|
LockValue
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TXFZUVJP.js";
|
|
13
13
|
|
|
14
14
|
// src/utils/cloudflare/cloudflare-cache.ts
|
|
15
15
|
var store = {
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isHTMLResponse,
|
|
3
3
|
makeCSPHeader
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2ZKE4AI4.js";
|
|
5
5
|
import {
|
|
6
6
|
UseCSPInputSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TXFZUVJP.js";
|
|
8
8
|
|
|
9
9
|
// src/middlewares/use-content-security-policy.ts
|
|
10
|
+
function generateCspNonce() {
|
|
11
|
+
const bytes = new Uint8Array(16);
|
|
12
|
+
crypto.getRandomValues(bytes);
|
|
13
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
14
|
+
}
|
|
10
15
|
var AppendAttribute = (attribute, nonce) => ({
|
|
11
16
|
element: function(element) {
|
|
12
17
|
element.setAttribute(attribute, nonce);
|
|
@@ -31,7 +36,7 @@ var useContentSecurityPolicy = (input) => {
|
|
|
31
36
|
if (response.headers.has("Content-Type") && !isHTMLResponse(response)) {
|
|
32
37
|
return;
|
|
33
38
|
}
|
|
34
|
-
const cspNonce =
|
|
39
|
+
const cspNonce = generateCspNonce();
|
|
35
40
|
const [cspHeaderName, cspHeaderValue] = makeCSPHeader(
|
|
36
41
|
cspNonce,
|
|
37
42
|
config.directives,
|
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-LRDZKQI3.js";
|
|
5
|
+
import "../chunk-YJSTNZGA.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-L4UHIU77.js";
|
|
13
13
|
import {
|
|
14
14
|
TEMPORARY_REDIRECT_STATUS,
|
|
15
15
|
buildLockPageUrl,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
parseMergedConfig,
|
|
24
24
|
printMessage,
|
|
25
25
|
sanitizeConfigErrors
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-2ZKE4AI4.js";
|
|
27
27
|
import {
|
|
28
28
|
AppwardenApiHostnameSchema,
|
|
29
29
|
AppwardenApiTokenSchema,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
HEARTBEAT_SERVICES,
|
|
32
32
|
UseCSPInputSchema,
|
|
33
33
|
ValidLockPageSlugSchema
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-TXFZUVJP.js";
|
|
35
35
|
|
|
36
36
|
// src/adapters/astro-cloudflare.ts
|
|
37
37
|
import { env as cloudflareEnv, waitUntil } from "cloudflare:workers";
|
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-L4UHIU77.js";
|
|
11
11
|
import {
|
|
12
12
|
TEMPORARY_REDIRECT_STATUS,
|
|
13
13
|
buildLockPageUrl,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
parseMergedConfig,
|
|
22
22
|
printMessage,
|
|
23
23
|
sanitizeConfigErrors
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-2ZKE4AI4.js";
|
|
25
25
|
import {
|
|
26
26
|
AppwardenApiHostnameSchema,
|
|
27
27
|
AppwardenApiTokenSchema,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
HEARTBEAT_SERVICES,
|
|
30
30
|
UseCSPInputSchema,
|
|
31
31
|
ValidLockPageSlugSchema
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-TXFZUVJP.js";
|
|
33
33
|
|
|
34
34
|
// src/adapters/nextjs-cloudflare.ts
|
|
35
35
|
import { getCloudflareContext } from "@opennextjs/cloudflare";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyContentSecurityPolicyToResponse,
|
|
3
3
|
isResponseLike
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LRDZKQI3.js";
|
|
5
|
+
import "../chunk-YJSTNZGA.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-L4UHIU77.js";
|
|
13
13
|
import {
|
|
14
14
|
buildLockPageUrl,
|
|
15
15
|
createHeartbeatConfigError,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
parseMergedConfig,
|
|
23
23
|
printMessage,
|
|
24
24
|
sanitizeConfigErrors
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-2ZKE4AI4.js";
|
|
26
26
|
import {
|
|
27
27
|
AppwardenApiHostnameSchema,
|
|
28
28
|
AppwardenApiTokenSchema,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
HEARTBEAT_SERVICES,
|
|
31
31
|
UseCSPInputSchema,
|
|
32
32
|
ValidLockPageSlugSchema
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-TXFZUVJP.js";
|
|
34
34
|
|
|
35
35
|
// src/adapters/react-router-cloudflare.ts
|
|
36
36
|
import { waitUntil } from "cloudflare:workers";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyContentSecurityPolicyToResponse,
|
|
3
3
|
isResponseLike
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LRDZKQI3.js";
|
|
5
|
+
import "../chunk-YJSTNZGA.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-L4UHIU77.js";
|
|
13
13
|
import {
|
|
14
14
|
buildLockPageUrl,
|
|
15
15
|
createHeartbeatConfigError,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
parseMergedConfig,
|
|
23
23
|
printMessage,
|
|
24
24
|
sanitizeConfigErrors
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-2ZKE4AI4.js";
|
|
26
26
|
import {
|
|
27
27
|
AppwardenApiHostnameSchema,
|
|
28
28
|
AppwardenApiTokenSchema,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
HEARTBEAT_SERVICES,
|
|
31
31
|
UseCSPInputSchema,
|
|
32
32
|
ValidLockPageSlugSchema
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-TXFZUVJP.js";
|
|
34
34
|
|
|
35
35
|
// src/adapters/tanstack-start-cloudflare.ts
|
|
36
36
|
import { waitUntil } from "cloudflare:workers";
|
package/cloudflare.d.ts
CHANGED
|
@@ -516,6 +516,7 @@ declare const ConfigFnInputSchema: z.ZodFunction<z.ZodTuple<[z.ZodType<RequestCo
|
|
|
516
516
|
debug: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>, boolean, string | boolean | undefined>>;
|
|
517
517
|
}, "strip", z.ZodTypeAny, {
|
|
518
518
|
lockPageSlug: string;
|
|
519
|
+
debug?: boolean | undefined;
|
|
519
520
|
contentSecurityPolicy?: {
|
|
520
521
|
mode: "disabled" | "report-only" | "enforced";
|
|
521
522
|
directives?: {
|
|
@@ -547,9 +548,9 @@ declare const ConfigFnInputSchema: z.ZodFunction<z.ZodTuple<[z.ZodType<RequestCo
|
|
|
547
548
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
548
549
|
} | undefined;
|
|
549
550
|
} | undefined;
|
|
550
|
-
debug?: boolean | undefined;
|
|
551
551
|
}, {
|
|
552
552
|
lockPageSlug: string;
|
|
553
|
+
debug?: string | boolean | undefined;
|
|
553
554
|
contentSecurityPolicy?: {
|
|
554
555
|
mode: "disabled" | "report-only" | "enforced";
|
|
555
556
|
directives: string | {
|
|
@@ -581,7 +582,6 @@ declare const ConfigFnInputSchema: z.ZodFunction<z.ZodTuple<[z.ZodType<RequestCo
|
|
|
581
582
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
582
583
|
};
|
|
583
584
|
} | undefined;
|
|
584
|
-
debug?: string | boolean | undefined;
|
|
585
585
|
}>>>;
|
|
586
586
|
appwardenApiToken: z.ZodEffects<z.ZodString, string, string>;
|
|
587
587
|
appwardenApiHostname: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
@@ -622,6 +622,7 @@ declare const ConfigFnInputSchema: z.ZodFunction<z.ZodTuple<[z.ZodType<RequestCo
|
|
|
622
622
|
} | undefined;
|
|
623
623
|
multidomainConfig?: Record<string, {
|
|
624
624
|
lockPageSlug: string;
|
|
625
|
+
debug?: boolean | undefined;
|
|
625
626
|
contentSecurityPolicy?: {
|
|
626
627
|
mode: "disabled" | "report-only" | "enforced";
|
|
627
628
|
directives?: {
|
|
@@ -653,11 +654,11 @@ declare const ConfigFnInputSchema: z.ZodFunction<z.ZodTuple<[z.ZodType<RequestCo
|
|
|
653
654
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
654
655
|
} | undefined;
|
|
655
656
|
} | undefined;
|
|
656
|
-
debug?: boolean | undefined;
|
|
657
657
|
}> | undefined;
|
|
658
658
|
appwardenApiHostname?: string | undefined;
|
|
659
659
|
}, {
|
|
660
660
|
appwardenApiToken: string;
|
|
661
|
+
debug?: string | boolean | undefined;
|
|
661
662
|
lockPageSlug?: string | undefined;
|
|
662
663
|
contentSecurityPolicy?: {
|
|
663
664
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -690,9 +691,9 @@ declare const ConfigFnInputSchema: z.ZodFunction<z.ZodTuple<[z.ZodType<RequestCo
|
|
|
690
691
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
691
692
|
};
|
|
692
693
|
} | undefined;
|
|
693
|
-
debug?: string | boolean | undefined;
|
|
694
694
|
multidomainConfig?: Record<string, {
|
|
695
695
|
lockPageSlug: string;
|
|
696
|
+
debug?: string | boolean | undefined;
|
|
696
697
|
contentSecurityPolicy?: {
|
|
697
698
|
mode: "disabled" | "report-only" | "enforced";
|
|
698
699
|
directives: string | {
|
|
@@ -724,7 +725,6 @@ declare const ConfigFnInputSchema: z.ZodFunction<z.ZodTuple<[z.ZodType<RequestCo
|
|
|
724
725
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
725
726
|
};
|
|
726
727
|
} | undefined;
|
|
727
|
-
debug?: string | boolean | undefined;
|
|
728
728
|
}> | undefined;
|
|
729
729
|
appwardenApiHostname?: string | undefined;
|
|
730
730
|
}>, any, any>>>;
|
|
@@ -1246,6 +1246,7 @@ declare const RefinedUseAppwardenInputSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
1246
1246
|
debug: zod.ZodOptional<zod.ZodEffects<zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodBoolean]>>, boolean, string | boolean | undefined>>;
|
|
1247
1247
|
}, "strip", zod.ZodTypeAny, {
|
|
1248
1248
|
lockPageSlug: string;
|
|
1249
|
+
debug?: boolean | undefined;
|
|
1249
1250
|
contentSecurityPolicy?: {
|
|
1250
1251
|
mode: "disabled" | "report-only" | "enforced";
|
|
1251
1252
|
directives?: {
|
|
@@ -1277,9 +1278,9 @@ declare const RefinedUseAppwardenInputSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
1277
1278
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
1278
1279
|
} | undefined;
|
|
1279
1280
|
} | undefined;
|
|
1280
|
-
debug?: boolean | undefined;
|
|
1281
1281
|
}, {
|
|
1282
1282
|
lockPageSlug: string;
|
|
1283
|
+
debug?: string | boolean | undefined;
|
|
1283
1284
|
contentSecurityPolicy?: {
|
|
1284
1285
|
mode: "disabled" | "report-only" | "enforced";
|
|
1285
1286
|
directives: string | {
|
|
@@ -1311,7 +1312,6 @@ declare const RefinedUseAppwardenInputSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
1311
1312
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
1312
1313
|
};
|
|
1313
1314
|
} | undefined;
|
|
1314
|
-
debug?: string | boolean | undefined;
|
|
1315
1315
|
}>>>;
|
|
1316
1316
|
appwardenApiToken: zod.ZodEffects<zod.ZodString, string, string>;
|
|
1317
1317
|
appwardenApiHostname: zod.ZodOptional<zod.ZodEffects<zod.ZodEffects<zod.ZodString, string, string>, string, string>>;
|
|
@@ -1352,6 +1352,7 @@ declare const RefinedUseAppwardenInputSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
1352
1352
|
} | undefined;
|
|
1353
1353
|
multidomainConfig?: Record<string, {
|
|
1354
1354
|
lockPageSlug: string;
|
|
1355
|
+
debug?: boolean | undefined;
|
|
1355
1356
|
contentSecurityPolicy?: {
|
|
1356
1357
|
mode: "disabled" | "report-only" | "enforced";
|
|
1357
1358
|
directives?: {
|
|
@@ -1383,11 +1384,11 @@ declare const RefinedUseAppwardenInputSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
1383
1384
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
1384
1385
|
} | undefined;
|
|
1385
1386
|
} | undefined;
|
|
1386
|
-
debug?: boolean | undefined;
|
|
1387
1387
|
}> | undefined;
|
|
1388
1388
|
appwardenApiHostname?: string | undefined;
|
|
1389
1389
|
}, {
|
|
1390
1390
|
appwardenApiToken: string;
|
|
1391
|
+
debug?: string | boolean | undefined;
|
|
1391
1392
|
lockPageSlug?: string | undefined;
|
|
1392
1393
|
contentSecurityPolicy?: {
|
|
1393
1394
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -1420,9 +1421,9 @@ declare const RefinedUseAppwardenInputSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
1420
1421
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
1421
1422
|
};
|
|
1422
1423
|
} | undefined;
|
|
1423
|
-
debug?: string | boolean | undefined;
|
|
1424
1424
|
multidomainConfig?: Record<string, {
|
|
1425
1425
|
lockPageSlug: string;
|
|
1426
|
+
debug?: string | boolean | undefined;
|
|
1426
1427
|
contentSecurityPolicy?: {
|
|
1427
1428
|
mode: "disabled" | "report-only" | "enforced";
|
|
1428
1429
|
directives: string | {
|
|
@@ -1454,7 +1455,6 @@ declare const RefinedUseAppwardenInputSchema: zod.ZodEffects<zod.ZodObject<{
|
|
|
1454
1455
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
1455
1456
|
};
|
|
1456
1457
|
} | undefined;
|
|
1457
|
-
debug?: string | boolean | undefined;
|
|
1458
1458
|
}> | undefined;
|
|
1459
1459
|
appwardenApiHostname?: string | undefined;
|
|
1460
1460
|
}>, any, any>;
|
package/cloudflare.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UseAppwardenInputSchema,
|
|
3
3
|
lockPageSlugRefinement
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IAOONP5L.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-YJSTNZGA.js";
|
|
11
11
|
import {
|
|
12
12
|
checkLockStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-L4UHIU77.js";
|
|
14
14
|
import {
|
|
15
15
|
buildLockPageUrl,
|
|
16
16
|
createHeartbeatConfigError,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
parseMergedConfig,
|
|
24
24
|
printMessage,
|
|
25
25
|
sanitizeConfigErrors
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-2ZKE4AI4.js";
|
|
27
27
|
import {
|
|
28
28
|
HEARTBEAT_SERVICES
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TXFZUVJP.js";
|
|
30
30
|
|
|
31
31
|
// src/runners/appwarden-on-cloudflare.ts
|
|
32
32
|
import { ZodError } from "zod";
|
|
@@ -58,17 +58,23 @@ var usePipeline = (...initMiddlewares) => {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
// src/utils/cloudflare/insert-errors-logs.ts
|
|
61
|
+
function htmlEscape(str) {
|
|
62
|
+
return str.replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026");
|
|
63
|
+
}
|
|
61
64
|
var insertErrorLogs = async (context, error) => {
|
|
62
65
|
const errors = getErrors(error);
|
|
63
66
|
for (const err of errors) {
|
|
64
67
|
console.log(printMessage(err));
|
|
65
68
|
}
|
|
69
|
+
const safeErrors = JSON.stringify(
|
|
70
|
+
errors.map((err) => printMessage(err))
|
|
71
|
+
);
|
|
72
|
+
const escapedErrors = htmlEscape(safeErrors);
|
|
66
73
|
return new HTMLRewriter().on("body", {
|
|
67
74
|
element: (elem) => {
|
|
75
|
+
elem.setAttribute("data-appwarden-logs", escapedErrors);
|
|
68
76
|
elem.append(
|
|
69
|
-
`<script>
|
|
70
|
-
${errors.map((err) => `console.error(\`${printMessage(err)}\`)`).join("\n")}
|
|
71
|
-
</script>`,
|
|
77
|
+
`<script>const logs=JSON.parse(document.body.getAttribute("data-appwarden-logs"));for(const log of logs){console.error(log)}</script>`,
|
|
72
78
|
{ html: true }
|
|
73
79
|
);
|
|
74
80
|
}
|
package/index.d.ts
CHANGED
|
@@ -710,6 +710,7 @@ 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;
|
|
713
714
|
contentSecurityPolicy?: {
|
|
714
715
|
mode: "disabled" | "report-only" | "enforced";
|
|
715
716
|
directives?: {
|
|
@@ -741,9 +742,9 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
|
|
|
741
742
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
742
743
|
} | undefined;
|
|
743
744
|
} | undefined;
|
|
744
|
-
debug?: boolean | undefined;
|
|
745
745
|
}, {
|
|
746
746
|
lockPageSlug: string;
|
|
747
|
+
debug?: string | boolean | undefined;
|
|
747
748
|
contentSecurityPolicy?: {
|
|
748
749
|
mode: "disabled" | "report-only" | "enforced";
|
|
749
750
|
directives: string | {
|
|
@@ -775,7 +776,6 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
|
|
|
775
776
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
776
777
|
};
|
|
777
778
|
} | undefined;
|
|
778
|
-
debug?: string | boolean | undefined;
|
|
779
779
|
}>>>;
|
|
780
780
|
appwardenApiToken: z.ZodEffects<z.ZodString, string, string>;
|
|
781
781
|
appwardenApiHostname: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
@@ -816,6 +816,7 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
|
|
|
816
816
|
} | undefined;
|
|
817
817
|
multidomainConfig?: Record<string, {
|
|
818
818
|
lockPageSlug: string;
|
|
819
|
+
debug?: boolean | undefined;
|
|
819
820
|
contentSecurityPolicy?: {
|
|
820
821
|
mode: "disabled" | "report-only" | "enforced";
|
|
821
822
|
directives?: {
|
|
@@ -847,11 +848,11 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
|
|
|
847
848
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
848
849
|
} | undefined;
|
|
849
850
|
} | undefined;
|
|
850
|
-
debug?: boolean | undefined;
|
|
851
851
|
}> | undefined;
|
|
852
852
|
appwardenApiHostname?: string | undefined;
|
|
853
853
|
}, {
|
|
854
854
|
appwardenApiToken: string;
|
|
855
|
+
debug?: string | boolean | undefined;
|
|
855
856
|
lockPageSlug?: string | undefined;
|
|
856
857
|
contentSecurityPolicy?: {
|
|
857
858
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -884,9 +885,9 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
|
|
|
884
885
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
885
886
|
};
|
|
886
887
|
} | undefined;
|
|
887
|
-
debug?: string | boolean | undefined;
|
|
888
888
|
multidomainConfig?: Record<string, {
|
|
889
889
|
lockPageSlug: string;
|
|
890
|
+
debug?: string | boolean | undefined;
|
|
890
891
|
contentSecurityPolicy?: {
|
|
891
892
|
mode: "disabled" | "report-only" | "enforced";
|
|
892
893
|
directives: string | {
|
|
@@ -918,7 +919,6 @@ declare const UseAppwardenInputSchema: z.ZodObject<{
|
|
|
918
919
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
919
920
|
};
|
|
920
921
|
} | 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-
|
|
8
|
+
} from "./chunk-IAOONP5L.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-
|
|
31
|
+
} from "./chunk-TXFZUVJP.js";
|
|
32
32
|
export {
|
|
33
33
|
APPWARDEN_CACHE_KEY,
|
|
34
34
|
APPWARDEN_HEARTBEAT_ROUTE,
|
package/package.json
CHANGED
package/vercel.d.ts
CHANGED
|
@@ -318,6 +318,7 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
318
318
|
lockPageSlug: string;
|
|
319
319
|
appwardenApiToken: string;
|
|
320
320
|
cacheUrl: string;
|
|
321
|
+
debug?: boolean | undefined;
|
|
321
322
|
contentSecurityPolicy?: {
|
|
322
323
|
mode: "disabled" | "report-only" | "enforced";
|
|
323
324
|
directives?: {
|
|
@@ -349,12 +350,12 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
349
350
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
350
351
|
} | undefined;
|
|
351
352
|
} | undefined;
|
|
352
|
-
debug?: boolean | undefined;
|
|
353
353
|
appwardenApiHostname?: string | undefined;
|
|
354
354
|
vercelApiToken?: string | undefined;
|
|
355
355
|
}, {
|
|
356
356
|
appwardenApiToken: string;
|
|
357
357
|
cacheUrl: string;
|
|
358
|
+
debug?: boolean | undefined;
|
|
358
359
|
lockPageSlug?: string | undefined;
|
|
359
360
|
contentSecurityPolicy?: {
|
|
360
361
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -387,13 +388,13 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
387
388
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
388
389
|
};
|
|
389
390
|
} | undefined;
|
|
390
|
-
debug?: boolean | undefined;
|
|
391
391
|
appwardenApiHostname?: string | undefined;
|
|
392
392
|
vercelApiToken?: string | undefined;
|
|
393
393
|
}>, {
|
|
394
394
|
lockPageSlug: string;
|
|
395
395
|
appwardenApiToken: string;
|
|
396
396
|
cacheUrl: string;
|
|
397
|
+
debug?: boolean | undefined;
|
|
397
398
|
contentSecurityPolicy?: {
|
|
398
399
|
mode: "disabled" | "report-only" | "enforced";
|
|
399
400
|
directives?: {
|
|
@@ -425,12 +426,12 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
425
426
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
426
427
|
} | undefined;
|
|
427
428
|
} | undefined;
|
|
428
|
-
debug?: boolean | undefined;
|
|
429
429
|
appwardenApiHostname?: string | undefined;
|
|
430
430
|
vercelApiToken?: string | undefined;
|
|
431
431
|
}, {
|
|
432
432
|
appwardenApiToken: string;
|
|
433
433
|
cacheUrl: string;
|
|
434
|
+
debug?: boolean | undefined;
|
|
434
435
|
lockPageSlug?: string | undefined;
|
|
435
436
|
contentSecurityPolicy?: {
|
|
436
437
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -463,13 +464,13 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
463
464
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
464
465
|
};
|
|
465
466
|
} | undefined;
|
|
466
|
-
debug?: boolean | undefined;
|
|
467
467
|
appwardenApiHostname?: string | undefined;
|
|
468
468
|
vercelApiToken?: string | undefined;
|
|
469
469
|
}>, {
|
|
470
470
|
lockPageSlug: string;
|
|
471
471
|
appwardenApiToken: string;
|
|
472
472
|
cacheUrl: string;
|
|
473
|
+
debug?: boolean | undefined;
|
|
473
474
|
contentSecurityPolicy?: {
|
|
474
475
|
mode: "disabled" | "report-only" | "enforced";
|
|
475
476
|
directives?: {
|
|
@@ -501,12 +502,12 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
501
502
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
502
503
|
} | undefined;
|
|
503
504
|
} | undefined;
|
|
504
|
-
debug?: boolean | undefined;
|
|
505
505
|
appwardenApiHostname?: string | undefined;
|
|
506
506
|
vercelApiToken?: string | undefined;
|
|
507
507
|
}, {
|
|
508
508
|
appwardenApiToken: string;
|
|
509
509
|
cacheUrl: string;
|
|
510
|
+
debug?: boolean | undefined;
|
|
510
511
|
lockPageSlug?: string | undefined;
|
|
511
512
|
contentSecurityPolicy?: {
|
|
512
513
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -539,13 +540,13 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
539
540
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
540
541
|
};
|
|
541
542
|
} | undefined;
|
|
542
|
-
debug?: boolean | undefined;
|
|
543
543
|
appwardenApiHostname?: string | undefined;
|
|
544
544
|
vercelApiToken?: string | undefined;
|
|
545
545
|
}>, {
|
|
546
546
|
lockPageSlug: string;
|
|
547
547
|
appwardenApiToken: string;
|
|
548
548
|
cacheUrl: string;
|
|
549
|
+
debug?: boolean | undefined;
|
|
549
550
|
contentSecurityPolicy?: {
|
|
550
551
|
mode: "disabled" | "report-only" | "enforced";
|
|
551
552
|
directives?: {
|
|
@@ -577,12 +578,12 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
577
578
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
578
579
|
} | undefined;
|
|
579
580
|
} | undefined;
|
|
580
|
-
debug?: boolean | undefined;
|
|
581
581
|
appwardenApiHostname?: string | undefined;
|
|
582
582
|
vercelApiToken?: string | undefined;
|
|
583
583
|
}, {
|
|
584
584
|
appwardenApiToken: string;
|
|
585
585
|
cacheUrl: string;
|
|
586
|
+
debug?: boolean | undefined;
|
|
586
587
|
lockPageSlug?: string | undefined;
|
|
587
588
|
contentSecurityPolicy?: {
|
|
588
589
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -615,13 +616,13 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
615
616
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
616
617
|
};
|
|
617
618
|
} | undefined;
|
|
618
|
-
debug?: boolean | undefined;
|
|
619
619
|
appwardenApiHostname?: string | undefined;
|
|
620
620
|
vercelApiToken?: string | undefined;
|
|
621
621
|
}>, {
|
|
622
622
|
lockPageSlug: string;
|
|
623
623
|
appwardenApiToken: string;
|
|
624
624
|
cacheUrl: string;
|
|
625
|
+
debug?: boolean | undefined;
|
|
625
626
|
contentSecurityPolicy?: {
|
|
626
627
|
mode: "disabled" | "report-only" | "enforced";
|
|
627
628
|
directives?: {
|
|
@@ -653,12 +654,12 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
653
654
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
654
655
|
} | undefined;
|
|
655
656
|
} | undefined;
|
|
656
|
-
debug?: boolean | undefined;
|
|
657
657
|
appwardenApiHostname?: string | undefined;
|
|
658
658
|
vercelApiToken?: string | undefined;
|
|
659
659
|
}, {
|
|
660
660
|
appwardenApiToken: string;
|
|
661
661
|
cacheUrl: string;
|
|
662
|
+
debug?: boolean | undefined;
|
|
662
663
|
lockPageSlug?: string | undefined;
|
|
663
664
|
contentSecurityPolicy?: {
|
|
664
665
|
mode: "disabled" | "report-only" | "enforced";
|
|
@@ -691,7 +692,6 @@ declare const AppwardenConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
|
|
|
691
692
|
"require-trusted-types-for"?: string | boolean | string[] | undefined;
|
|
692
693
|
};
|
|
693
694
|
} | undefined;
|
|
694
|
-
debug?: boolean | undefined;
|
|
695
695
|
appwardenApiHostname?: string | undefined;
|
|
696
696
|
vercelApiToken?: string | undefined;
|
|
697
697
|
}>;
|
package/vercel.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
parseMergedConfig,
|
|
22
22
|
printMessage,
|
|
23
23
|
sanitizeConfigErrors
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-2ZKE4AI4.js";
|
|
25
25
|
import {
|
|
26
26
|
APPWARDEN_CACHE_KEY,
|
|
27
27
|
APPWARDEN_MIDDLEWARE_USER_AGENT,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
ValidLockPageSlugSchema,
|
|
34
34
|
errors,
|
|
35
35
|
globalErrors
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-TXFZUVJP.js";
|
|
37
37
|
|
|
38
38
|
// src/runners/appwarden-on-vercel.ts
|
|
39
39
|
import { waitUntil } from "@vercel/functions";
|