@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.
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  applyContentSecurityPolicyToResponse,
3
3
  isResponseLike
4
- } from "../chunk-7BZFEX4Z.js";
5
- import "../chunk-DM57ZOTI.js";
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-PCWFMNHW.js";
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-2FSRHIPY.js";
25
+ } from "../chunk-2ZKE4AI4.js";
25
26
  import {
26
27
  AppwardenApiHostnameSchema,
27
28
  AppwardenApiTokenSchema,
28
29
  BooleanSchema,
29
30
  HEARTBEAT_SERVICES,
30
- UseCSPInputSchema
31
- } from "../chunk-LDKC5DRW.js";
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: z.string(),
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
  };