@appwarden/middleware 3.14.1 → 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-2FSRHIPY.js → chunk-2ZKE4AI4.js} +50 -2
- package/{chunk-JJOX4UAG.js → chunk-IAOONP5L.js} +5 -4
- package/{chunk-PCWFMNHW.js → chunk-L4UHIU77.js} +17 -4
- package/{chunk-7BZFEX4Z.js → chunk-LRDZKQI3.js} +1 -1
- package/{chunk-LDKC5DRW.js → chunk-TXFZUVJP.js} +21 -2
- package/{chunk-DM57ZOTI.js → chunk-YJSTNZGA.js} +8 -3
- package/cloudflare/astro.d.ts +13 -6
- package/cloudflare/astro.js +18 -8
- package/cloudflare/nextjs.d.ts +5 -4
- package/cloudflare/nextjs.js +16 -6
- package/cloudflare/react-router.d.ts +5 -4
- package/cloudflare/react-router.js +18 -8
- package/cloudflare/tanstack-start.d.ts +6 -4
- package/cloudflare/tanstack-start.js +18 -8
- package/cloudflare.d.ts +733 -4
- package/cloudflare.js +26 -8
- package/index.d.ts +3 -3
- package/index.js +2 -2
- package/package.json +19 -13
- package/scripts/appwarden-link.cjs +851 -0
- package/vercel.d.ts +4 -3
- package/vercel.js +34 -6
|
@@ -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,
|
|
@@ -19,16 +19,18 @@ import {
|
|
|
19
19
|
isHTMLRequest,
|
|
20
20
|
isHeartbeatRequest,
|
|
21
21
|
isOnLockPage,
|
|
22
|
+
parseMergedConfig,
|
|
22
23
|
printMessage,
|
|
23
24
|
sanitizeConfigErrors
|
|
24
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-2ZKE4AI4.js";
|
|
25
26
|
import {
|
|
26
27
|
AppwardenApiHostnameSchema,
|
|
27
28
|
AppwardenApiTokenSchema,
|
|
28
29
|
BooleanSchema,
|
|
29
30
|
HEARTBEAT_SERVICES,
|
|
30
|
-
UseCSPInputSchema
|
|
31
|
-
|
|
31
|
+
UseCSPInputSchema,
|
|
32
|
+
ValidLockPageSlugSchema
|
|
33
|
+
} from "../chunk-TXFZUVJP.js";
|
|
32
34
|
|
|
33
35
|
// src/adapters/tanstack-start-cloudflare.ts
|
|
34
36
|
import { waitUntil } from "cloudflare:workers";
|
|
@@ -37,7 +39,7 @@ import { waitUntil } from "cloudflare:workers";
|
|
|
37
39
|
import { z } from "zod";
|
|
38
40
|
var TanStackStartCloudflareConfigSchema = z.object({
|
|
39
41
|
/** The slug/path of the lock page to redirect to when the site is locked */
|
|
40
|
-
lockPageSlug:
|
|
42
|
+
lockPageSlug: ValidLockPageSlugSchema,
|
|
41
43
|
/** The Appwarden API token for authentication */
|
|
42
44
|
appwardenApiToken: AppwardenApiTokenSchema,
|
|
43
45
|
/** Optional custom API hostname (defaults to https://api.appwarden.io) */
|
|
@@ -49,6 +51,13 @@ var TanStackStartCloudflareConfigSchema = z.object({
|
|
|
49
51
|
});
|
|
50
52
|
|
|
51
53
|
// src/adapters/tanstack-start-cloudflare.ts
|
|
54
|
+
function getAppwardenConfiguration(generatedConfig, config) {
|
|
55
|
+
return parseMergedConfig(
|
|
56
|
+
generatedConfig,
|
|
57
|
+
config,
|
|
58
|
+
TanStackStartCloudflareConfigSchema.parse
|
|
59
|
+
);
|
|
60
|
+
}
|
|
52
61
|
var createTanStackHeartbeatResponse = (request, configFn) => {
|
|
53
62
|
try {
|
|
54
63
|
const validationResult = TanStackStartCloudflareConfigSchema.safeParse(configFn());
|
|
@@ -165,5 +174,6 @@ function createAppwardenMiddleware(configFn) {
|
|
|
165
174
|
return middleware;
|
|
166
175
|
}
|
|
167
176
|
export {
|
|
168
|
-
createAppwardenMiddleware
|
|
177
|
+
createAppwardenMiddleware,
|
|
178
|
+
getAppwardenConfiguration
|
|
169
179
|
};
|