@guren/server 2.15.0 → 2.16.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.
Files changed (296) hide show
  1. package/dist/{DocsViewerServiceProvider-qFCaeiUv.js → DocsViewerServiceProvider-D2cuVgtN.js} +7 -12
  2. package/dist/{Hash-C8aejmi8.js → Hash-D2DFd8xX.js} +7 -57
  3. package/dist/{HttpException-BkS3euNG.js → HttpException-BlQ2yEmT.js} +2 -79
  4. package/dist/{Job-BVT813DO.js → Job-DxQK8h3P.js} +24 -179
  5. package/dist/{McpServiceProvider-BawsYjgN.js → McpServiceProvider-nNcbCIQX.js} +11 -20
  6. package/dist/{Random-DbIJ22KQ.js → Random-S0OvCuR8.js} +9 -106
  7. package/dist/agent/AgentApprovalRequested.d.ts +11 -39
  8. package/dist/agent/approval.d.ts +76 -187
  9. package/dist/agent/audit-emitter.d.ts +16 -44
  10. package/dist/agent/audit.d.ts +20 -56
  11. package/dist/agent/derive.d.ts +32 -66
  12. package/dist/agent/dispatch.d.ts +38 -90
  13. package/dist/agent/events.d.ts +11 -19
  14. package/dist/agent/meta-tools.d.ts +18 -46
  15. package/dist/agent/public.d.ts +6 -25
  16. package/dist/agent/public.js +1 -1
  17. package/dist/agent/redact.d.ts +16 -38
  18. package/dist/agent/scopes.d.ts +23 -69
  19. package/dist/auth/AuthManager.d.ts +19 -40
  20. package/dist/auth/AuthenticatableModel.d.ts +2 -2
  21. package/dist/auth/SessionGuard.d.ts +0 -1
  22. package/dist/auth/TokenGuard.d.ts +6 -26
  23. package/dist/auth/api-token.d.ts +16 -148
  24. package/dist/auth/context.d.ts +5 -10
  25. package/dist/auth/email-verification.d.ts +29 -127
  26. package/dist/auth/index.js +1 -1
  27. package/dist/auth/oauth/index.d.ts +35 -57
  28. package/dist/auth/password/DefaultHasher.d.ts +5 -14
  29. package/dist/auth/password/PasswordHasher.d.ts +5 -13
  30. package/dist/auth/password/hash-format.d.ts +5 -13
  31. package/dist/auth/password-reset.d.ts +16 -42
  32. package/dist/auth/providers/ModelUserProvider.d.ts +3 -4
  33. package/dist/auth/providers/UserProvider.d.ts +4 -4
  34. package/dist/auth/signed-token.d.ts +18 -0
  35. package/dist/auth/types.d.ts +9 -32
  36. package/dist/auth/utils.d.ts +6 -27
  37. package/dist/{auth-DkYoAPVn.js → auth-CbdPH4Cd.js} +169 -502
  38. package/dist/authorization/Gate.d.ts +9 -145
  39. package/dist/authorization/Policy.d.ts +6 -53
  40. package/dist/authorization/index.js +1 -1
  41. package/dist/authorization/middleware.d.ts +16 -62
  42. package/dist/authorization/types.d.ts +8 -64
  43. package/dist/{authorization-CdfbCj8J.js → authorization-CdEWZZw3.js} +44 -309
  44. package/dist/broadcasting/BroadcastManager.d.ts +29 -149
  45. package/dist/broadcasting/channels/Channel.d.ts +1 -19
  46. package/dist/broadcasting/channels/PresenceChannel.d.ts +1 -55
  47. package/dist/broadcasting/channels/PrivateChannel.d.ts +1 -23
  48. package/dist/broadcasting/drivers/MemoryDriver.d.ts +18 -70
  49. package/dist/broadcasting/drivers/RedisDriver.d.ts +3 -80
  50. package/dist/broadcasting/drivers/index.d.ts +1 -1
  51. package/dist/broadcasting/index.d.ts +1 -1
  52. package/dist/broadcasting/index.js +1 -1
  53. package/dist/broadcasting/types.d.ts +7 -88
  54. package/dist/{broadcasting-BwodCA4q.js → broadcasting-B5RzB0A2.js} +87 -414
  55. package/dist/cache/CacheManager.d.ts +8 -62
  56. package/dist/cache/TaggedCache.d.ts +2 -35
  57. package/dist/cache/index.js +1 -1
  58. package/dist/cache/stores/FileStore.d.ts +2 -36
  59. package/dist/cache/stores/MemoryStore.d.ts +2 -26
  60. package/dist/cache/stores/RedisStore.d.ts +1 -29
  61. package/dist/cache/types.d.ts +21 -128
  62. package/dist/{cache-BYnZf2FR.js → cache-BOOIr324.js} +19 -198
  63. package/dist/client-C4TEr_Dd.js +9 -0
  64. package/dist/console/Command.d.ts +17 -126
  65. package/dist/console/ConsoleKernel.d.ts +2 -74
  66. package/dist/console/Input.d.ts +5 -113
  67. package/dist/console/Output.d.ts +3 -99
  68. package/dist/console/types.d.ts +3 -33
  69. package/dist/container/Container.d.ts +12 -103
  70. package/dist/container/ServiceProvider.d.ts +17 -61
  71. package/dist/container/bindings.d.ts +5 -26
  72. package/dist/container/defineModule.d.ts +16 -54
  73. package/dist/container/definePlugin.d.ts +12 -45
  74. package/dist/container/types.d.ts +2 -34
  75. package/dist/context-CXk_umpT.js +21 -0
  76. package/dist/database/Factory.d.ts +4 -57
  77. package/dist/database/Seeder.d.ts +8 -46
  78. package/dist/database/SeederRunner.d.ts +3 -33
  79. package/dist/database/types.d.ts +3 -24
  80. package/dist/discovery/AutoDiscovery.d.ts +10 -82
  81. package/dist/{dispatch-erOS9epZ.js → dispatch-BAwzftws.js} +32 -79
  82. package/dist/docs-viewer/DocsViewerServiceProvider.d.ts +2 -5
  83. package/dist/docs-viewer/endpoint.d.ts +5 -11
  84. package/dist/encryption/Encrypter.d.ts +5 -71
  85. package/dist/encryption/Hash.d.ts +7 -57
  86. package/dist/encryption/Random.d.ts +6 -99
  87. package/dist/encryption/index.js +3 -3
  88. package/dist/encryption/types.d.ts +10 -72
  89. package/dist/{encryption-D99Vmls3.js → encryption-uwP3Di4D.js} +9 -78
  90. package/dist/{endpoint-D6GIqOpe.js → endpoint-BXipU2Jj.js} +6 -12
  91. package/dist/endpoint-Dsw3Acvq.js +26 -0
  92. package/dist/errors/ExceptionHandler.d.ts +3 -90
  93. package/dist/errors/HttpException.d.ts +2 -79
  94. package/dist/errors/debug-page.d.ts +3 -17
  95. package/dist/errors/error-page.d.ts +1 -0
  96. package/dist/errors/exceptions/AuthenticationException.d.ts +2 -24
  97. package/dist/errors/exceptions/AuthorizationException.d.ts +1 -24
  98. package/dist/errors/exceptions/MethodNotAllowedException.d.ts +1 -23
  99. package/dist/errors/exceptions/NotFoundHttpException.d.ts +1 -27
  100. package/dist/errors/exceptions/ValidationException.d.ts +2 -43
  101. package/dist/errors/types.d.ts +1 -25
  102. package/dist/{errors-BgeOl_DC.js → errors-JpkcCjjn.js} +3 -41
  103. package/dist/events/Event.d.ts +1 -28
  104. package/dist/events/EventManager.d.ts +5 -107
  105. package/dist/events/Listener.d.ts +7 -55
  106. package/dist/events/builtin.d.ts +0 -24
  107. package/dist/events/index.js +1 -1
  108. package/dist/events/types.d.ts +4 -22
  109. package/dist/{events-aIH_bWRx.js → events-DOmAHDeP.js} +11 -191
  110. package/dist/facades/index.d.ts +2 -14
  111. package/dist/health/HealthCheck.d.ts +0 -24
  112. package/dist/health/HealthManager.d.ts +0 -36
  113. package/dist/health/checks/CacheCheck.d.ts +2 -17
  114. package/dist/health/checks/CustomCheck.d.ts +0 -9
  115. package/dist/health/checks/DatabaseCheck.d.ts +2 -17
  116. package/dist/health/checks/MemoryCheck.d.ts +3 -12
  117. package/dist/health/checks/RedisCheck.d.ts +1 -13
  118. package/dist/health/checks/StorageCheck.d.ts +2 -17
  119. package/dist/health/index.js +1 -1
  120. package/dist/health/types.d.ts +4 -24
  121. package/dist/{health-VWdWXRwh.js → health-DQSvUplL.js} +1 -76
  122. package/dist/hot-disposables-B5BXqaIH.js +167 -0
  123. package/dist/hot-reload/hot-disposables.d.ts +22 -74
  124. package/dist/hot-reload/testing.d.ts +4 -9
  125. package/dist/http/Application.d.ts +62 -208
  126. package/dist/http/FormRequest.d.ts +4 -55
  127. package/dist/http/dev-assets.d.ts +13 -31
  128. package/dist/http/dev-banner.d.ts +2 -5
  129. package/dist/http/inertia-assets.d.ts +3 -6
  130. package/dist/http/middleware/capabilities.d.ts +27 -50
  131. package/dist/http/middleware/cors.d.ts +4 -29
  132. package/dist/http/middleware/csp.d.ts +2 -25
  133. package/dist/http/middleware/csrf.d.ts +20 -95
  134. package/dist/http/middleware/detect-locale.d.ts +7 -27
  135. package/dist/http/middleware/force-https.d.ts +6 -24
  136. package/dist/http/middleware/host-authorization.d.ts +2 -12
  137. package/dist/http/middleware/loopback-guard.d.ts +15 -33
  138. package/dist/http/middleware/rate-limit.d.ts +29 -126
  139. package/dist/http/middleware/redirect-safety.d.ts +2 -20
  140. package/dist/http/middleware/request-id.d.ts +1 -14
  141. package/dist/http/middleware/request-logging.d.ts +2 -13
  142. package/dist/http/middleware/response-headers.d.ts +5 -13
  143. package/dist/http/middleware/security-headers.d.ts +2 -16
  144. package/dist/http/middleware/session.d.ts +15 -34
  145. package/dist/http/middleware/validation-errors-cookie.d.ts +7 -18
  146. package/dist/http/middleware/validation.d.ts +8 -63
  147. package/dist/http/public-assets.d.ts +11 -7
  148. package/dist/http/request.d.ts +32 -118
  149. package/dist/http/resources/CursorPaginator.d.ts +5 -64
  150. package/dist/http/resources/Paginator.d.ts +7 -84
  151. package/dist/http/resources/Resource.d.ts +9 -65
  152. package/dist/http/resources/ResourceCollection.d.ts +5 -39
  153. package/dist/http/resources/types.d.ts +10 -30
  154. package/dist/http/static-documents.d.ts +10 -20
  155. package/dist/http/validation/Validator.d.ts +25 -85
  156. package/dist/http/validation/rules.d.ts +48 -147
  157. package/dist/http/validation/types.d.ts +16 -61
  158. package/dist/http/vite-assets.d.ts +5 -28
  159. package/dist/http/vite-dev-server.d.ts +6 -9
  160. package/dist/http/vite-manifest.d.ts +19 -33
  161. package/dist/i18n/I18nManager.d.ts +12 -78
  162. package/dist/i18n/Translator.d.ts +3 -54
  163. package/dist/i18n/index.js +1 -1
  164. package/dist/i18n/loaders/JsonLoader.d.ts +4 -31
  165. package/dist/i18n/loaders/MemoryLoader.d.ts +1 -21
  166. package/dist/i18n/pluralization.d.ts +4 -13
  167. package/dist/i18n/types.d.ts +17 -69
  168. package/dist/{i18n-mcWi7LCd.js → i18n-Cg1aajRP.js} +31 -225
  169. package/dist/index.d.ts +2 -1
  170. package/dist/index.js +714 -3011
  171. package/dist/internal/agent-preflight.d.ts +9 -21
  172. package/dist/internal/request.d.ts +6 -19
  173. package/dist/internal/request.js +1 -1
  174. package/dist/internal/route-path.d.ts +9 -21
  175. package/dist/internal/route-path.js +9 -21
  176. package/dist/internal/zod-compat.d.ts +55 -122
  177. package/dist/internal/zod-compat.js +39 -70
  178. package/dist/internal/zod-json-schema.d.ts +18 -54
  179. package/dist/internal/zod-json-schema.js +46 -123
  180. package/dist/jsx-runtime.d.ts +3 -8
  181. package/dist/lambda/index.d.ts +17 -79
  182. package/dist/lambda/index.js +11 -59
  183. package/dist/logging/LogManager.d.ts +1 -51
  184. package/dist/logging/Logger.d.ts +8 -47
  185. package/dist/logging/channels/ConsoleChannel.d.ts +1 -3
  186. package/dist/logging/channels/DailyFileChannel.d.ts +1 -3
  187. package/dist/logging/channels/FileChannel.d.ts +1 -3
  188. package/dist/logging/daily-file-path.d.ts +7 -16
  189. package/dist/logging/index.js +1 -1
  190. package/dist/logging/types.d.ts +13 -45
  191. package/dist/{logging-B-kngi3q.js → logging-zOY1XCtq.js} +52 -141
  192. package/dist/{loopback-guard-D0Kc7-xc.js → loopback-guard-DT9gHF0F.js} +41 -92
  193. package/dist/mail/Mail.d.ts +10 -106
  194. package/dist/mail/MailManager.d.ts +2 -60
  195. package/dist/mail/index.js +1 -1
  196. package/dist/mail/transports/LogTransport.d.ts +1 -4
  197. package/dist/mail/transports/MemoryTransport.d.ts +1 -63
  198. package/dist/mail/transports/ResendTransport.d.ts +1 -23
  199. package/dist/mail/transports/SmtpTransport.d.ts +1 -31
  200. package/dist/mail/types.d.ts +28 -150
  201. package/dist/{mail-DfEfSQEr.js → mail-76DWy9lj.js} +31 -289
  202. package/dist/mcp/McpServiceProvider.d.ts +4 -10
  203. package/dist/mcp/create-mcp-server.d.ts +25 -57
  204. package/dist/mcp/endpoint.d.ts +12 -36
  205. package/dist/mcp/index.js +1 -1
  206. package/dist/mvc/Controller.d.ts +46 -227
  207. package/dist/mvc/Router.d.ts +50 -129
  208. package/dist/mvc/inertia/InertiaEngine.d.ts +18 -48
  209. package/dist/mvc/inertia/shared.d.ts +6 -19
  210. package/dist/mvc/mount-route.d.ts +2 -6
  211. package/dist/mvc/view.d.ts +1 -2
  212. package/dist/notifications/Notification.d.ts +8 -75
  213. package/dist/notifications/NotificationManager.d.ts +15 -88
  214. package/dist/notifications/channels/DatabaseChannel.d.ts +1 -41
  215. package/dist/notifications/channels/MailChannel.d.ts +2 -31
  216. package/dist/notifications/channels/MemoryChannel.d.ts +2 -62
  217. package/dist/notifications/channels/SlackChannel.d.ts +3 -48
  218. package/dist/notifications/index.js +1 -1
  219. package/dist/notifications/notifiable-type.d.ts +3 -6
  220. package/dist/notifications/registry.d.ts +8 -27
  221. package/dist/notifications/types.d.ts +16 -53
  222. package/dist/{notifications-BGqmUNZ8.js → notifications-okWFs9ly.js} +37 -335
  223. package/dist/providers/AuthServiceProvider.d.ts +1 -3
  224. package/dist/providers/AuthorizationServiceProvider.d.ts +2 -3
  225. package/dist/providers/BroadcastServiceProvider.d.ts +1 -3
  226. package/dist/providers/CacheServiceProvider.d.ts +1 -3
  227. package/dist/providers/EncryptionServiceProvider.d.ts +1 -3
  228. package/dist/providers/ErrorServiceProvider.d.ts +1 -4
  229. package/dist/providers/EventServiceProvider.d.ts +1 -3
  230. package/dist/providers/HealthServiceProvider.d.ts +1 -3
  231. package/dist/providers/I18nServiceProvider.d.ts +6 -10
  232. package/dist/providers/InertiaServiceProvider.d.ts +1 -4
  233. package/dist/providers/LogServiceProvider.d.ts +1 -3
  234. package/dist/providers/MailServiceProvider.d.ts +1 -3
  235. package/dist/providers/NotificationServiceProvider.d.ts +1 -3
  236. package/dist/providers/OAuthServiceProvider.d.ts +1 -3
  237. package/dist/providers/QueueServiceProvider.d.ts +1 -3
  238. package/dist/providers/SchedulingServiceProvider.d.ts +1 -3
  239. package/dist/providers/StorageServiceProvider.d.ts +1 -3
  240. package/dist/queue/FailedJobReporter.d.ts +1 -24
  241. package/dist/queue/Job.d.ts +12 -99
  242. package/dist/queue/QueueManager.d.ts +6 -57
  243. package/dist/queue/Worker.d.ts +4 -65
  244. package/dist/queue/drivers/MemoryDriver.d.ts +3 -44
  245. package/dist/queue/drivers/RedisDriver.d.ts +7 -65
  246. package/dist/queue/drivers/SqsDriver.d.ts +6 -57
  247. package/dist/queue/drivers/SyncDriver.d.ts +10 -13
  248. package/dist/queue/index.js +2 -2
  249. package/dist/queue/types.d.ts +10 -92
  250. package/dist/{queue-CXrRK85G.js → queue-CcXCjuJI.js} +32 -260
  251. package/dist/redis/RedisApiTokenStore.d.ts +4 -56
  252. package/dist/redis/RedisEmailVerificationStore.d.ts +4 -37
  253. package/dist/redis/RedisOAuthStateStore.d.ts +2 -10
  254. package/dist/redis/RedisPasswordResetStore.d.ts +4 -37
  255. package/dist/redis/RedisRateLimitStore.d.ts +16 -49
  256. package/dist/redis/RedisSessionStore.d.ts +3 -44
  257. package/dist/redis/client.d.ts +2 -32
  258. package/dist/redis/index.js +47 -232
  259. package/dist/redis/redis-values.d.ts +6 -12
  260. package/dist/redis/scan-keys.d.ts +1 -4
  261. package/dist/request-CLOYytGP.js +68 -0
  262. package/dist/runtime/index.d.ts +2 -0
  263. package/dist/runtime/index.js +50 -92
  264. package/dist/scheduling/CronParser.d.ts +0 -29
  265. package/dist/scheduling/Schedule.d.ts +1 -153
  266. package/dist/scheduling/ScheduledTask.d.ts +0 -31
  267. package/dist/scheduling/Scheduler.d.ts +0 -70
  268. package/dist/scheduling/index.js +1 -1
  269. package/dist/scheduling/types.d.ts +4 -65
  270. package/dist/{scheduling-CPiEdtQd.js → scheduling-C6tcOtUl.js} +2 -287
  271. package/dist/storage/StorageManager.d.ts +0 -48
  272. package/dist/storage/drivers/LocalDriver.d.ts +1 -25
  273. package/dist/storage/drivers/MemoryDriver.d.ts +5 -35
  274. package/dist/storage/drivers/S3Driver.d.ts +6 -36
  275. package/dist/storage/drivers/s3-acl.d.ts +5 -10
  276. package/dist/storage/index.js +1 -1
  277. package/dist/storage/types.d.ts +27 -265
  278. package/dist/{storage-TLD9t0Q2.js → storage-BB59f07j.js} +17 -157
  279. package/dist/support/contained-path.d.ts +10 -20
  280. package/dist/support/error-polyfill.d.ts +4 -6
  281. package/dist/support/expiry.d.ts +17 -33
  282. package/dist/support/expiry.js +17 -33
  283. package/dist/support/import-map.d.ts +3 -7
  284. package/dist/support/inertia-defaults.d.ts +5 -10
  285. package/dist/support/redirect-target.d.ts +4 -6
  286. package/dist/support/stack-frames.d.ts +11 -50
  287. package/dist/support/trim-slashes.d.ts +4 -7
  288. package/dist/support/warn-once.d.ts +2 -6
  289. package/dist/{trim-slashes-ZJ_VsY5s.js → trim-slashes-BLY9hKAa.js} +4 -7
  290. package/dist/{vite-manifest-w_RSOvQW.js → vite-manifest-CTQp-SOo.js} +34 -58
  291. package/package.json +2 -2
  292. package/dist/client-Dd7vLcqp.js +0 -27
  293. package/dist/context-DoD0c7J_.js +0 -26
  294. package/dist/endpoint-D-20PiHY.js +0 -46
  295. package/dist/hot-disposables-WsTX2ySN.js +0 -281
  296. package/dist/request-CVQwpu2J.js +0 -129
@@ -1,4 +1,4 @@
1
- import { t as trimSlashes } from "./trim-slashes-ZJ_VsY5s.js";
1
+ import { t as trimSlashes } from "./trim-slashes-BLY9hKAa.js";
2
2
  import { copyFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
3
3
  import { dirname, join, resolve, sep } from "node:path";
4
4
  import { existsSync } from "node:fs";
@@ -6,12 +6,8 @@ import { Readable } from "node:stream";
6
6
  //#region src/support/warn-once.ts
7
7
  const warned = /* @__PURE__ */ new Set();
8
8
  /**
9
- * Emit a warning the first time a given key is seen in this process.
10
- *
11
- * Deprecation warnings have to be loud enough to be read once and quiet
12
- * enough not to drown a request log, which is the same shape the OAuth
13
- * warnings settled on (`auth/oauth/index.ts`) — this is that pattern with a
14
- * key, so several call sites can share it.
9
+ * Warn the first time a key is seen in this process: loud enough to be read
10
+ * once, quiet enough not to drown a request log.
15
11
  */
16
12
  function warnOnce(key, message) {
17
13
  if (warned.has(key)) return;
@@ -20,20 +16,6 @@ function warnOnce(key, message) {
20
16
  }
21
17
  //#endregion
22
18
  //#region src/storage/drivers/LocalDriver.ts
23
- /**
24
- * Local filesystem storage driver.
25
- *
26
- * @example
27
- * ```ts
28
- * const driver = new LocalDriver({
29
- * root: './storage/app',
30
- * url: '/storage',
31
- * })
32
- *
33
- * await driver.put('avatars/user-1.jpg', imageBuffer)
34
- * const url = driver.url('avatars/user-1.jpg')
35
- * ```
36
- */
37
19
  var LocalDriver = class {
38
20
  root;
39
21
  baseUrl;
@@ -43,19 +25,12 @@ var LocalDriver = class {
43
25
  this.baseUrl = options.url ?? "";
44
26
  this.defaultVisibility = options.visibility ?? "private";
45
27
  }
46
- /**
47
- * Get the full path for a file.
48
- * Rejects paths that resolve outside the storage root (e.g. via `../`).
49
- */
50
28
  fullPath(path) {
51
29
  const root = resolve(this.root);
52
30
  const candidate = resolve(root, path);
53
31
  if (candidate !== root && !candidate.startsWith(root + sep)) throw new Error(`LocalDriver: path escapes the storage root: "${path}"`);
54
32
  return candidate;
55
33
  }
56
- /**
57
- * Ensure the directory exists.
58
- */
59
34
  async ensureDirectory(filePath) {
60
35
  const dir = dirname(filePath);
61
36
  if (!existsSync(dir)) await mkdir(dir, { recursive: true });
@@ -136,7 +111,7 @@ var LocalDriver = class {
136
111
  url(path) {
137
112
  return `${this.baseUrl}/${path}`;
138
113
  }
139
- async temporaryUrl(path, expiration) {
114
+ async temporaryUrl(path, _expiration) {
140
115
  return this.url(path);
141
116
  }
142
117
  async size(path) {
@@ -213,30 +188,23 @@ var LocalDriver = class {
213
188
  if (requested === this.defaultVisibility) return;
214
189
  warnOnce(`local-visibility-per-object:${operation}`, `[guren] LocalDriver.${operation}() was asked to make an object ${requested} on a ${this.defaultVisibility} disk, and did nothing. A local disk has no per-object visibility — what makes a file reachable is the disk root and whatever serves it — so the request was never carried out, it only looked like it was. Declare the disk's "visibility" option to match, or keep restricted files on a disk that is not served. This becomes an error in the next major.`);
215
190
  }
216
- /**
217
- * Get the root directory.
218
- */
219
191
  getRoot() {
220
192
  return this.root;
221
193
  }
222
194
  };
223
195
  //#endregion
224
196
  //#region src/storage/drivers/s3-acl.ts
225
- /** The canned ACL S3 uses for each visibility. */
226
197
  function cannedAcl(visibility) {
227
198
  return visibility === "public" ? "public-read" : "private";
228
199
  }
229
200
  /**
230
- * The `ACL` field for a `PutObject` input, or nothing when the endpoint has
231
- * no ACLs. Returned as a spreadable object so the caller never sends an
232
- * explicit `ACL: undefined`, which some S3 implementations reject outright
233
- * rather than treat as absent.
201
+ * Spreadable so the caller never sends an explicit `ACL: undefined`, which some
202
+ * S3 implementations reject outright rather than treat as absent.
234
203
  */
235
204
  function putAclFields(acl, visibility) {
236
205
  return acl ? { ACL: cannedAcl(visibility) } : {};
237
206
  }
238
207
  /**
239
- * Guard for a per-object visibility an ACL-less endpoint cannot honour.
240
208
  * Throws rather than silently dropping the request: a `setVisibility(path,
241
209
  * 'private')` that does nothing on a public bucket is a leak that looks like
242
210
  * success.
@@ -247,23 +215,7 @@ function assertVisibilitySupported(acl, diskVisibility, requested, operation) {
247
215
  }
248
216
  //#endregion
249
217
  //#region src/storage/drivers/S3Driver.ts
250
- /**
251
- * AWS S3 storage driver.
252
- *
253
- * @example
254
- * ```ts
255
- * import { S3Client } from '@aws-sdk/client-s3'
256
- *
257
- * const client = new S3Client({ region: 'ap-northeast-1' })
258
- * const driver = new S3Driver({
259
- * client,
260
- * bucket: 'my-bucket',
261
- * })
262
- *
263
- * await driver.put('avatars/user-1.jpg', imageBuffer)
264
- * const url = driver.url('avatars/user-1.jpg')
265
- * ```
266
- */
218
+ /** AWS S3 storage driver. */
267
219
  var S3Driver = class {
268
220
  options;
269
221
  capabilities = { presignedGet: true };
@@ -290,9 +242,6 @@ var S3Driver = class {
290
242
  this.defaultVisibility = options.visibility ?? "private";
291
243
  this.acl = options.acl ?? true;
292
244
  }
293
- /**
294
- * Get or create the S3 client.
295
- */
296
245
  async getClient() {
297
246
  if (this.client) return this.client;
298
247
  const { S3Client } = await importAwsModule("@aws-sdk/client-s3");
@@ -308,9 +257,6 @@ var S3Driver = class {
308
257
  this.client = new S3Client(config);
309
258
  return this.client;
310
259
  }
311
- /**
312
- * Get the prefixed key.
313
- */
314
260
  prefixKey(path) {
315
261
  return this.prefix ? `${this.prefix}/${path}` : path;
316
262
  }
@@ -485,9 +431,8 @@ var S3Driver = class {
485
431
  return metadata;
486
432
  }
487
433
  /**
488
- * Run ListObjectsV2 to exhaustion, following `NextContinuationToken` —
489
- * a single request returns at most 1000 entries, so a one-page read
490
- * silently truncates larger listings.
434
+ * Follows `NextContinuationToken` to exhaustion: one request returns at most
435
+ * 1000 entries, so a single-page read silently truncates larger listings.
491
436
  */
492
437
  async listAll(input) {
493
438
  const client = await this.getClient();
@@ -515,10 +460,9 @@ var S3Driver = class {
515
460
  };
516
461
  }
517
462
  /**
518
- * The ListObjectsV2 `Prefix` for a directory: the prefixed key with exactly
519
- * one trailing slash, or empty for the bucket (or disk prefix) root —
520
- * naively appending `/` to `prefixKey('')` on a prefixed disk yields
521
- * `prefix//`, which matches nothing.
463
+ * The prefixed key with exactly one trailing slash, empty at the root —
464
+ * appending `/` to `prefixKey('')` on a prefixed disk yields `prefix//`,
465
+ * which matches nothing.
522
466
  */
523
467
  listingPrefix(directory) {
524
468
  const prefix = this.prefixKey(directory);
@@ -585,15 +529,9 @@ var S3Driver = class {
585
529
  });
586
530
  return (await client.send(command)).Grants?.some((grant) => grant.Grantee?.URI === "http://acs.amazonaws.com/groups/global/AllUsers" && grant.Permission === "READ") ? "public" : "private";
587
531
  }
588
- /**
589
- * Get the bucket name.
590
- */
591
532
  getBucket() {
592
533
  return this.bucket;
593
534
  }
594
- /**
595
- * Get the prefix.
596
- */
597
535
  getPrefix() {
598
536
  return this.prefix;
599
537
  }
@@ -614,47 +552,25 @@ async function importAwsModule(moduleName) {
614
552
  }
615
553
  //#endregion
616
554
  //#region src/storage/drivers/MemoryDriver.ts
617
- /**
618
- * In-memory storage driver for testing.
619
- *
620
- * @example
621
- * ```ts
622
- * const driver = new MemoryDriver()
623
- *
624
- * await driver.put('avatars/user-1.jpg', imageBuffer)
625
- * const content = await driver.get('avatars/user-1.jpg')
626
- * ```
627
- */
555
+ /** In-memory storage driver for testing. */
628
556
  var MemoryDriver = class {
629
557
  storage = /* @__PURE__ */ new Map();
630
558
  baseUrl;
631
559
  constructor(options = {}) {
632
560
  this.baseUrl = options.url ?? "memory://";
633
561
  }
634
- /**
635
- * Normalize path (remove leading/trailing slashes).
636
- */
637
562
  normalizePath(path) {
638
563
  return trimSlashes(path);
639
564
  }
640
- /**
641
- * Get directory from path.
642
- */
643
565
  getDirectory(path) {
644
566
  return path.split("/").slice(0, -1).join("/");
645
567
  }
646
- /**
647
- * Check if a path is in a directory.
648
- */
649
568
  isInDirectory(filePath, directory) {
650
569
  const normalized = this.normalizePath(filePath);
651
570
  const normalizedDir = this.normalizePath(directory);
652
571
  if (!normalizedDir) return !normalized.includes("/");
653
572
  return normalized.startsWith(normalizedDir + "/") && !normalized.slice(normalizedDir.length + 1).includes("/");
654
573
  }
655
- /**
656
- * Check if a path is under a directory (recursive).
657
- */
658
574
  isUnderDirectory(filePath, directory) {
659
575
  const normalized = this.normalizePath(filePath);
660
576
  const normalizedDir = this.normalizePath(directory);
@@ -673,7 +589,7 @@ var MemoryDriver = class {
673
589
  });
674
590
  return normalized;
675
591
  }
676
- async putFile(path, localPath, options) {
592
+ async putFile(_path, _localPath, _options) {
677
593
  throw new Error("putFile is not supported in MemoryDriver");
678
594
  }
679
595
  async get(path) {
@@ -718,7 +634,7 @@ var MemoryDriver = class {
718
634
  const normalized = this.normalizePath(path);
719
635
  return `${this.baseUrl}/${normalized}`;
720
636
  }
721
- async temporaryUrl(path, expiration) {
637
+ async temporaryUrl(path, _expiration) {
722
638
  return this.url(path);
723
639
  }
724
640
  async size(path) {
@@ -768,7 +684,7 @@ var MemoryDriver = class {
768
684
  for (const path of this.storage.keys()) if (this.isUnderDirectory(path, normalized)) result.push(path);
769
685
  return result.sort();
770
686
  }
771
- async makeDirectory(path) {}
687
+ async makeDirectory(_path) {}
772
688
  async deleteDirectory(path) {
773
689
  const normalized = this.normalizePath(path);
774
690
  const keysToDelete = [];
@@ -787,47 +703,19 @@ var MemoryDriver = class {
787
703
  if (!file) throw new Error(`File not found: ${path}`);
788
704
  return file.visibility;
789
705
  }
790
- /**
791
- * Clear all files (for testing).
792
- */
706
+ /** Testing only. */
793
707
  clear() {
794
708
  this.storage.clear();
795
709
  }
796
- /**
797
- * Get the number of stored files.
798
- */
799
710
  count() {
800
711
  return this.storage.size;
801
712
  }
802
- /**
803
- * Get all stored file paths.
804
- */
805
713
  getAllPaths() {
806
714
  return Array.from(this.storage.keys());
807
715
  }
808
716
  };
809
717
  //#endregion
810
718
  //#region src/storage/StorageManager.ts
811
- /**
812
- * Storage manager for handling multiple storage disks.
813
- *
814
- * @example
815
- * ```ts
816
- * const storage = new StorageManager({
817
- * default: 'local',
818
- * disks: {
819
- * local: { driver: 'local', root: './storage/app' },
820
- * s3: { driver: 's3', bucket: 'my-bucket', region: 'ap-northeast-1' },
821
- * }
822
- * })
823
- *
824
- * // Use the default disk
825
- * await storage.disk().put('avatars/user-1.jpg', imageBuffer)
826
- *
827
- * // Use a specific disk
828
- * await storage.disk('s3').put('avatars/user-1.jpg', imageBuffer)
829
- * ```
830
- */
831
719
  var StorageManager = class {
832
720
  defaultDiskName;
833
721
  diskFactories = /* @__PURE__ */ new Map();
@@ -839,9 +727,6 @@ var StorageManager = class {
839
727
  if (config.disks) for (const [name, diskConfig] of Object.entries(config.disks)) this.registerDiskFromConfig(name, diskConfig);
840
728
  if (!this.diskFactories.has(this.defaultDiskName) && this.defaultDiskName === "local") this.diskFactories.set("local", () => new LocalDriver({ root: "./storage" }));
841
729
  }
842
- /**
843
- * Register built-in disk drivers.
844
- */
845
730
  registerBuiltinDrivers() {
846
731
  this.driverFactories.set("local", (options) => {
847
732
  return new LocalDriver(options);
@@ -853,19 +738,12 @@ var StorageManager = class {
853
738
  return new MemoryDriver(options);
854
739
  });
855
740
  }
856
- /**
857
- * Register a disk from configuration.
858
- */
859
741
  registerDiskFromConfig(name, config) {
860
742
  const { driver, ...options } = config;
861
743
  const factory = this.driverFactories.get(driver);
862
744
  if (!factory) throw new Error(`Unknown storage driver: ${driver}`);
863
745
  this.diskFactories.set(name, () => factory(options));
864
746
  }
865
- /**
866
- * Get a storage disk by name.
867
- * Returns the default disk if no name is specified.
868
- */
869
747
  disk(name) {
870
748
  const diskName = name ?? this.defaultDiskName;
871
749
  const cached = this.resolvedDisks.get(diskName);
@@ -876,41 +754,23 @@ var StorageManager = class {
876
754
  this.resolvedDisks.set(diskName, disk);
877
755
  return disk;
878
756
  }
879
- /**
880
- * Register a custom disk factory.
881
- */
882
757
  registerDisk(name, factory) {
883
758
  this.diskFactories.set(name, factory);
884
759
  this.resolvedDisks.delete(name);
885
760
  }
886
- /**
887
- * Register a custom driver.
888
- */
889
761
  registerDriver(name, factory) {
890
762
  this.driverFactories.set(name, factory);
891
763
  }
892
- /**
893
- * Check if a disk is registered.
894
- */
895
764
  hasDisk(name) {
896
765
  return this.diskFactories.has(name);
897
766
  }
898
- /**
899
- * Get the default disk name.
900
- */
901
767
  getDefaultDiskName() {
902
768
  return this.defaultDiskName;
903
769
  }
904
- /**
905
- * Get all registered disk names.
906
- */
907
770
  getDiskNames() {
908
771
  return Array.from(this.diskFactories.keys());
909
772
  }
910
773
  };
911
- /**
912
- * Create a storage manager with configuration.
913
- */
914
774
  function createStorageManager(config) {
915
775
  return new StorageManager(config);
916
776
  }
@@ -1,26 +1,16 @@
1
1
  /**
2
- * Is `candidate` a path strictly below `root`, judged lexically?
3
- *
4
- * The trailing separator is what keeps out a sibling directory whose name
5
- * merely extends the root's (`…/inertia` vs `…/inertia-secrets`), and what
6
- * rejects an absolute `candidate` — which `resolve()` returns verbatim when a
7
- * doubled slash in the request path left the relative part rooted.
8
- *
9
- * Cheap, but not sufficient on its own: `resolve()` collapses `..` without
10
- * following symlinks. Use {@link isRealPathWithin} before reading the file.
2
+ * Lexical containment. The trailing separator keeps out a sibling whose name
3
+ * merely extends the root's (`…/inertia` vs `…/inertia-secrets`) and rejects an
4
+ * absolute `candidate`, which `resolve()` returns verbatim. Not sufficient
5
+ * alone: `resolve()` collapses `..` without following symlinks, so use
6
+ * {@link isRealPathWithin} before reading the file.
11
7
  */
12
8
  export declare function isPathWithin(root: string, candidate: string): boolean;
13
9
  /**
14
- * Is `candidate` a path strictly below `root` once both are canonicalized?
15
- *
16
- * Every reader downstream of these checks (`Bun.file().text()`,
17
- * `.arrayBuffer()`, `new Response(file)`) follows symlinks, so a lexical check
18
- * alone accepts `<root>/link/secret` where `link` points out of the tree.
19
- * *Both* sides are canonicalized: a root reached through a symlink itself is
20
- * routine (workspace and pnpm layouts, macOS `/var` → `/private/var`), and
21
- * canonicalizing only the candidate would 404 every asset such an app serves.
22
- *
23
- * Call this on a path already known to exist — a path that does not exist
24
- * cannot be read, and `realpath` rejects it, so either way this fails closed.
10
+ * Containment once both sides are canonicalized. Every reader downstream
11
+ * (`Bun.file().text()`, `new Response(file)`) follows symlinks, so a lexical
12
+ * check alone accepts `<root>/link/secret`. *Both* sides, because a root
13
+ * reached through a symlink is routine (macOS `/var` → `/private/var`) and
14
+ * doing only the candidate would 404 every asset such an app serves.
25
15
  */
26
16
  export declare function isRealPathWithin(root: string, candidate: string): Promise<boolean>;
@@ -1,9 +1,7 @@
1
1
  /**
2
- * Bun 1.x tightened Error.captureStackTrace so it throws unless the first argument is an actual
3
- * Error instance. Some ecosystem packages (notably follow-redirects) still pass plain objects,
4
- * because Node silently upgrades them. When those packages execute during SSR boot we end up
5
- * crashing before Inertia can import the SSR entry. This shim mirrors Node's behavior by copying
6
- * a stack trace from a real Error onto whatever object was provided, ensuring third-party code
7
- * keeps working regardless of Bun's stricter contract.
2
+ * Bun 1.x throws from Error.captureStackTrace unless the first argument is a
3
+ * real Error. Packages that pass plain objects (notably follow-redirects, which
4
+ * Node tolerates) then crash SSR boot before Inertia can import the SSR entry.
5
+ * This mirrors Node by copying a real Error's stack onto whatever it is given.
8
6
  */
9
7
  export declare function ensureErrorStackTracePolyfill(): void;
@@ -1,47 +1,31 @@
1
1
  /**
2
- * Expiry coercion and the one predicate that decides whether a stored expiry
3
- * has passed.
4
- *
5
- * This is the single copy. `packages/core/src/store-utils.ts` re-exports
6
- * `toDate`/`isExpired`/`toOptionalExpiry` from here through the
7
- * `@guren/server/support/expiry` subpath, so the database-backed stores and
8
- * the Redis ones decide expiry with the same code. It lives in this package
9
- * because `@guren/core` depends on `@guren/server` and not the other way
10
- * around — core is unreachable from here without a dependency cycle.
11
- *
12
- * Not part of the public API: the subpath exists for that re-export, and
13
- * neither package's index exposes these.
2
+ * The single copy of expiry coercion: `packages/core/src/store-utils.ts`
3
+ * re-exports these through the `@guren/server/support/expiry` subpath, so the
4
+ * database-backed and Redis stores decide expiry with the same code. It lives
5
+ * here because core depends on server and not the reverse. Not public API —
6
+ * neither package's index exposes it.
14
7
  */
15
8
  /**
16
- * Coerce a stored timestamp, rejecting anything unparseable.
17
- *
18
- * Accepts every shape a driver or a Redis value can hand back: Date, number,
19
- * bigint (MySQL / postgres.js BIGINT), digit-only strings as epoch
20
- * milliseconds, and ISO strings. A Date wrapping garbage is a parse failure,
21
- * not a value — `new Date(garbage)` yields an Invalid Date whose comparisons
22
- * are all false, which is exactly how a corrupt expiry reads as "not past".
9
+ * Accepts every shape a driver or Redis value hands back: Date, number, bigint
10
+ * (MySQL / postgres.js BIGINT), digit-only strings as epoch milliseconds, ISO
11
+ * strings. An Invalid Date is a parse failure, not a value: its comparisons are
12
+ * all false, which is exactly how a corrupt expiry reads as "not past".
23
13
  */
24
14
  export declare function toDate(value: unknown): Date | null;
25
15
  /**
26
- * Whether an expiry that is required to be present has passed.
27
- *
28
- * Missing or unparseable counts as expired, so a malformed record can never be
29
- * accepted indefinitely. Use for sessions and OAuth state, whose writers always
30
- * supply an expiry.
16
+ * For an expiry required to be present (sessions, OAuth state). Missing or
17
+ * unparseable counts as expired, so a malformed record is never accepted
18
+ * indefinitely.
31
19
  */
32
20
  export declare function isExpired(value: unknown, now?: number): boolean;
33
21
  /**
34
- * Whether an expiry that is allowed to be absent has passed.
35
- *
36
- * Absent means "never expires" and is never past. Present-but-unparseable is a
37
- * malformed record and counts as expired — collapsing the two is the fail-open
38
- * this exists to close. Use at the point of comparison, so the check holds for
39
- * every store implementation including ones this package never sees.
22
+ * Absent means "never expires"; present-but-unparseable counts as expired.
23
+ * Collapsing the two is the fail-open this exists to close. Call it at the
24
+ * point of comparison so the rule holds for stores this package never sees.
40
25
  */
41
26
  export declare function isOptionalExpiryPast(value: unknown, now?: number): boolean;
42
27
  /**
43
- * Coerce an expiry that is allowed to be absent into a value callers can
44
- * compare directly: absent stays null, present-but-unparseable degrades to a
45
- * long-past date rather than to null, which would read as "never expires".
28
+ * Absent stays null; present-but-unparseable degrades to a long-past date
29
+ * rather than null, which would read as "never expires".
46
30
  */
47
31
  export declare function toOptionalExpiry(value: unknown): Date | null;
@@ -1,26 +1,16 @@
1
1
  //#region src/support/expiry.ts
2
2
  /**
3
- * Expiry coercion and the one predicate that decides whether a stored expiry
4
- * has passed.
5
- *
6
- * This is the single copy. `packages/core/src/store-utils.ts` re-exports
7
- * `toDate`/`isExpired`/`toOptionalExpiry` from here through the
8
- * `@guren/server/support/expiry` subpath, so the database-backed stores and
9
- * the Redis ones decide expiry with the same code. It lives in this package
10
- * because `@guren/core` depends on `@guren/server` and not the other way
11
- * around — core is unreachable from here without a dependency cycle.
12
- *
13
- * Not part of the public API: the subpath exists for that re-export, and
14
- * neither package's index exposes these.
3
+ * The single copy of expiry coercion: `packages/core/src/store-utils.ts`
4
+ * re-exports these through the `@guren/server/support/expiry` subpath, so the
5
+ * database-backed and Redis stores decide expiry with the same code. It lives
6
+ * here because core depends on server and not the reverse. Not public API —
7
+ * neither package's index exposes it.
15
8
  */
16
9
  /**
17
- * Coerce a stored timestamp, rejecting anything unparseable.
18
- *
19
- * Accepts every shape a driver or a Redis value can hand back: Date, number,
20
- * bigint (MySQL / postgres.js BIGINT), digit-only strings as epoch
21
- * milliseconds, and ISO strings. A Date wrapping garbage is a parse failure,
22
- * not a value — `new Date(garbage)` yields an Invalid Date whose comparisons
23
- * are all false, which is exactly how a corrupt expiry reads as "not past".
10
+ * Accepts every shape a driver or Redis value hands back: Date, number, bigint
11
+ * (MySQL / postgres.js BIGINT), digit-only strings as epoch milliseconds, ISO
12
+ * strings. An Invalid Date is a parse failure, not a value: its comparisons are
13
+ * all false, which is exactly how a corrupt expiry reads as "not past".
24
14
  */
25
15
  function toDate(value) {
26
16
  const date = coerceDate(value);
@@ -34,32 +24,26 @@ function coerceDate(value) {
34
24
  return null;
35
25
  }
36
26
  /**
37
- * Whether an expiry that is required to be present has passed.
38
- *
39
- * Missing or unparseable counts as expired, so a malformed record can never be
40
- * accepted indefinitely. Use for sessions and OAuth state, whose writers always
41
- * supply an expiry.
27
+ * For an expiry required to be present (sessions, OAuth state). Missing or
28
+ * unparseable counts as expired, so a malformed record is never accepted
29
+ * indefinitely.
42
30
  */
43
31
  function isExpired(value, now = Date.now()) {
44
32
  const date = toDate(value);
45
33
  return date === null || date.getTime() <= now;
46
34
  }
47
35
  /**
48
- * Whether an expiry that is allowed to be absent has passed.
49
- *
50
- * Absent means "never expires" and is never past. Present-but-unparseable is a
51
- * malformed record and counts as expired — collapsing the two is the fail-open
52
- * this exists to close. Use at the point of comparison, so the check holds for
53
- * every store implementation including ones this package never sees.
36
+ * Absent means "never expires"; present-but-unparseable counts as expired.
37
+ * Collapsing the two is the fail-open this exists to close. Call it at the
38
+ * point of comparison so the rule holds for stores this package never sees.
54
39
  */
55
40
  function isOptionalExpiryPast(value, now = Date.now()) {
56
41
  if (value == null) return false;
57
42
  return isExpired(value, now);
58
43
  }
59
44
  /**
60
- * Coerce an expiry that is allowed to be absent into a value callers can
61
- * compare directly: absent stays null, present-but-unparseable degrades to a
62
- * long-past date rather than to null, which would read as "never expires".
45
+ * Absent stays null; present-but-unparseable degrades to a long-past date
46
+ * rather than null, which would read as "never expires".
63
47
  */
64
48
  function toOptionalExpiry(value) {
65
49
  if (value == null) return null;
@@ -1,13 +1,9 @@
1
1
  export interface ParseImportMapOptions {
2
- /**
3
- * Optional label describing the source of the import map.
4
- * Used in warning logs when parsing fails.
5
- */
2
+ /** Label used in the parse-failure warning. */
6
3
  context?: string;
7
4
  }
8
5
  /**
9
- * Parses an import map JSON string into a record of module specifiers.
10
- * Empty, null, and undefined entries are ignored so callers can safely
11
- * merge optional overrides without additional filtering.
6
+ * Empty, null and undefined entries are dropped, so callers can merge optional
7
+ * overrides without filtering first.
12
8
  */
13
9
  export declare function parseImportMap(value: string | undefined, options?: ParseImportMapOptions): Record<string, string>;
@@ -1,13 +1,8 @@
1
1
  /**
2
- * The stylesheet *source* path the dev asset configuration falls back to.
3
- *
4
- * Lives in a leaf module because two sides read it and must agree: the dev
5
- * configuration in `http/inertia-assets.ts` publishes it into
6
- * `GUREN_INERTIA_STYLES`, and the document renderer in
7
- * `mvc/inertia/InertiaEngine.ts` drops exactly this path again when a dev
8
- * server owns the script entry (the compiled CSS then arrives through the
9
- * module graph). Importing either of those modules from the other would drag
10
- * runtime-specific dependencies across the Workers/Lambda boundary or create
11
- * an import cycle.
2
+ * The stylesheet *source* path the dev asset configuration falls back to. A
3
+ * leaf module because two sides must agree on it: `http/inertia-assets.ts`
4
+ * publishes it into `GUREN_INERTIA_STYLES` and `mvc/inertia/InertiaEngine.ts`
5
+ * drops exactly this path when a dev server owns the script entry. Importing
6
+ * either from the other would cross the Workers/Lambda boundary or cycle.
12
7
  */
13
8
  export declare const DEFAULT_DEV_STYLES_ENTRY = "/resources/css/app.css";
@@ -1,11 +1,9 @@
1
1
  /**
2
- * Shared open-redirect classification primitives, used by both the
3
- * redirect-safety middleware and the OAuth `redirectTo` sanitizer. Keep every
4
- * hardening fix here so the two layers cannot drift.
2
+ * Open-redirect classification shared by the redirect-safety middleware and the
3
+ * OAuth `redirectTo` sanitizer. Every hardening fix belongs here so the two
4
+ * layers cannot drift.
5
5
  */
6
- /** Normalize backslash tricks (e.g. `/\evil.com`) before classifying. */
6
+ /** Defuses backslash tricks such as `/\evil.com`. */
7
7
  export declare function normalizeRedirectTarget(value: string): string;
8
- /** App-relative paths (`/path`, but not protocol-relative `//host`) are always safe. */
9
8
  export declare function isAppRelativePath(value: string): boolean;
10
- /** Match a URL's host against an allowlist supporting `*.example.com` wildcards. */
11
9
  export declare function hostMatchesAllowlist(target: URL, allowedHosts: readonly string[]): boolean;